# import bisect
# from collections import Counter, defaultdict, deque, namedtuple
# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
import itertools
# from operator import attrgetter, itemgetter
# import math

import sys

# import numpy as np

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
    n, a, b, c, d = list(map(int,ipti().split()))
    a -= 1
    b -= 1
    c -= 1
    d -= 1

    s = input()

    if c > d:
        s_groupby = itertools.groupby(s[b-1:d+2])
        for key, group in s_groupby:
            group_list = list(group)
            if key == "." and len(group_list) >= 3:
                break
        else:
            print('No')
            sys.exit()

    for i in range(a + 1, d):
        if s[i] == "#":
            if s[i + 1] == "#":
                print('No')
                sys.exit()

    print('Yes')

if __name__ == '__main__':
    main() import itertools itertools import sys sys ipti = sys.stdin.readline ipti sys.stdin.readline sys.stdin sys stdin readline MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 INF = float('INF') INF float('INF') float 'INF' sys.setrecursionlimit(10 ** 5) sys.setrecursionlimit sys setrecursionlimit 10 ** 5 10 5 def main():
    n, a, b, c, d = list(map(int,ipti().split()))
    a -= 1
    b -= 1
    c -= 1
    d -= 1

    s = input()

    if c > d:
        s_groupby = itertools.groupby(s[b-1:d+2])
        for key, group in s_groupby:
            group_list = list(group)
            if key == "." and len(group_list) >= 3:
                break
        else:
            print('No')
            sys.exit()

    for i in range(a + 1, d):
        if s[i] == "#":
            if s[i + 1] == "#":
                print('No')
                sys.exit()

    print('Yes') main n, a, b, c, d = list(map(int,ipti().split())) n list(map(int,ipti().split())) list map(int,ipti().split()) map int ipti().split() ().split () ipti split a b c d a -= 1 a 1 b -= 1 b 1 c -= 1 c 1 d -= 1 d 1 s = input() s input() input if c > d:
        s_groupby = itertools.groupby(s[b-1:d+2])
        for key, group in s_groupby:
            group_list = list(group)
            if key == "." and len(group_list) >= 3:
                break
        else:
            print('No')
            sys.exit()

     c > d c d s_groupby = itertools.groupby(s[b-1:d+2]) s_groupby itertools.groupby(s[b-1:d+2]) itertools.groupby itertools groupby s[b-1:d+2] s b-1:d+2 b-1 b 1 d+2 d 2 for key, group in s_groupby:
            group_list = list(group)
            if key == "." and len(group_list) >= 3:
                break
        else:
            print('No')
            sys.exit()

     key group s_groupby group_list = list(group) group_list list(group) list group if key == "." and len(group_list) >= 3:
                break
         key == "." and len(group_list) >= 3 key == "." key "." len(group_list) >= 3 len(group_list) len group_list 3 break print('No') print 'No' sys.exit() sys.exit sys exit for i in range(a + 1, d):
        if s[i] == "#":
            if s[i + 1] == "#":
                print('No')
                sys.exit()

     i range(a + 1, d) range a + 1 a 1 d if s[i] == "#":
            if s[i + 1] == "#":
                print('No')
                sys.exit()

     s[i] == "#" s[i] s i "#" if s[i + 1] == "#":
                print('No')
                sys.exit()

     s[i + 1] == "#" s[i + 1] s i + 1 i 1 "#" print('No') print 'No' sys.exit() sys.exit sys exit print('Yes') print 'Yes' if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main ipti = sys.stdin.readline sys.stdin.readline ipti def main():
    n, a, b, c, d = list(map(int,ipti().split()))
    a -= 1
    b -= 1
    c -= 1
    d -= 1

    s = input()

    if c > d:
        s_groupby = itertools.groupby(s[b-1:d+2])
        for key, group in s_groupby:
            group_list = list(group)
            if key == "." and len(group_list) >= 3:
                break
        else:
            print('No')
            sys.exit()

    for i in range(a + 1, d):
        if s[i] == "#":
            if s[i + 1] == "#":
                print('No')
                sys.exit()

    print('Yes') def main():
    n, a, b, c, d = list(map(int,ipti().split()))
    a -= 1
    b -= 1
    c -= 1
    d -= 1

    s = input()

    if c > d:
        s_groupby = itertools.groupby(s[b-1:d+2])
        for key, group in s_groupby:
            group_list = list(group)
            if key == "." and len(group_list) >= 3:
                break
        else:
            print('No')
            sys.exit()

    for i in range(a + 1, d):
        if s[i] == "#":
            if s[i + 1] == "#":
                print('No')
                sys.exit()

    print('Yes') main INF = float('INF') float('INF') INF MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD
# import bisect
# from collections import Counter, defaultdict, deque, namedtuple
# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
import itertools
# from operator import attrgetter, itemgetter
# import math

import sys

# import numpy as np

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
    n, a, b, c, d = list(map(int,ipti().split()))
    a -= 1
    b -= 1
    c -= 1
    d -= 1

    s = input()

    if c > d:
        s_groupby = itertools.groupby(s[b-1:d+2])
        for key, group in s_groupby:
            group_list = list(group)
            if key == "." and len(group_list) >= 3:
                break
        else:
            print('No')
            sys.exit()

    for i in range(a + 1, d):
        if s[i] == "#":
            if s[i + 1] == "#":
                print('No')
                sys.exit()

    print('Yes')

if __name__ == '__main__':
    main()
