import sys
input = sys.stdin.readline
N, A, B, C, D = map(int, input().split())
S = list(input())

# A < B < D, A < B < C
# A < D, B < C の間に # が2マス連続にあったらNo
# さらに D < C なら すぬけくんとふぬけくんが入れ替わる必要がある。
# すなわち3マス連続...が続いている必要がある(#が2マス連続ないことも注意)

left = A

if C < D:
    right = D
else:
    right = C
    idx = []
    for i in range(B - 2, D - 1):
        if S[i] == '.' and S[i + 1] == '.' and S[i + 2] == '.':
            idx.append(i)
    if not idx:
        print('No')
        exit()
    # print('idx', idx)
    # print('idx', S[idx[0]:idx[0] + 10])
# print('N, A, B, C, D', N, A, B, C, D)
T = S[left - 1:right + 1]
# print('T', T)
for i in range(len(T) - 1):
    if T[i] == '#' and T[i + 1] == '#':
        print('No')
        exit()

print('Yes') import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline N, A, B, C, D = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split A B C D S = list(input()) S list(input()) list input() input left = A left A if C < D:
    right = D
else:
    right = C
    idx = []
    for i in range(B - 2, D - 1):
        if S[i] == '.' and S[i + 1] == '.' and S[i + 2] == '.':
            idx.append(i)
    if not idx:
        print('No')
        exit()
    # print('idx', idx)
    # print('idx', S[idx[0]:idx[0] + 10])
# print('N, A, B, C, D', N, A, B, C, D) C < D C D right = D right D right = C right C idx = [] idx [] for i in range(B - 2, D - 1):
        if S[i] == '.' and S[i + 1] == '.' and S[i + 2] == '.':
            idx.append(i)
     i range(B - 2, D - 1) range B - 2 B 2 D - 1 D 1 if S[i] == '.' and S[i + 1] == '.' and S[i + 2] == '.':
            idx.append(i)
     S[i] == '.' and S[i + 1] == '.' and S[i + 2] == '.' S[i] == '.' and S[i + 1] == '.' S[i] == '.' S[i] S i '.' S[i + 1] == '.' S[i + 1] S i + 1 i 1 '.' S[i + 2] == '.' S[i + 2] S i + 2 i 2 '.' idx.append(i) idx.append idx append i if not idx:
        print('No')
        exit()
    # print('idx', idx)
    # print('idx', S[idx[0]:idx[0] + 10])
# print('N, A, B, C, D', N, A, B, C, D) not idx idx print('No') print 'No' exit() exit T = S[left - 1:right + 1] T S[left - 1:right + 1] S left - 1:right + 1 left - 1 left 1 right + 1 right 1 for i in range(len(T) - 1):
    if T[i] == '#' and T[i + 1] == '#':
        print('No')
        exit() i range(len(T) - 1) range len(T) - 1 len(T) len T 1 if T[i] == '#' and T[i + 1] == '#':
        print('No')
        exit() T[i] == '#' and T[i + 1] == '#' T[i] == '#' T[i] T i '#' T[i + 1] == '#' T[i + 1] T i + 1 i 1 '#' print('No') print 'No' exit() exit print('Yes') print 'Yes' D = map(int, input().split()) map(int, input().split()) D C, D = map(int, input().split()) map(int, input().split()) C input = sys.stdin.readline sys.stdin.readline input left = A A left T = S[left - 1:right + 1] S[left - 1:right + 1] T right = C C right N, A, B, C, D = map(int, input().split()) map(int, input().split()) N S = list(input()) list(input()) S A, B, C, D = map(int, input().split()) map(int, input().split()) A B, C, D = map(int, input().split()) map(int, input().split()) B right = D D right idx = [] [] idx
import sys
input = sys.stdin.readline
N, A, B, C, D = map(int, input().split())
S = list(input())

# A < B < D, A < B < C
# A < D, B < C の間に # が2マス連続にあったらNo
# さらに D < C なら すぬけくんとふぬけくんが入れ替わる必要がある。
# すなわち3マス連続...が続いている必要がある(#が2マス連続ないことも注意)

left = A

if C < D:
    right = D
else:
    right = C
    idx = []
    for i in range(B - 2, D - 1):
        if S[i] == '.' and S[i + 1] == '.' and S[i + 2] == '.':
            idx.append(i)
    if not idx:
        print('No')
        exit()
    # print('idx', idx)
    # print('idx', S[idx[0]:idx[0] + 10])
# print('N, A, B, C, D', N, A, B, C, D)
T = S[left - 1:right + 1]
# print('T', T)
for i in range(len(T) - 1):
    if T[i] == '#' and T[i + 1] == '#':
        print('No')
        exit()

print('Yes')
