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

A -= 1
B -= 1
C -= 1
D -= 1

right_end = max(C, D)
S = S[A:right_end+1]

ans = True
if A < B < C < D:
    if S.count('##'):
        ans = False
elif A < C < B < D:
    if S[A:C+1].count('##') or S[B:D+1].count('##'):
        ans = False
else:
    if S.count('##'):
        ans = False
    elif S[B:D+2].count('...'):
        pass
    elif S[B-1:B+2] == '...':
        pass
    else:
        ans = False

if ans:
    print('Yes')
else:
    print('No')

# print(S)
# print(iwaiwa)
# print(S[B-1:B+2]) N, A, B, C, D = list(map(int, input().split())) N list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split A B C D S = input() S input() input A -= 1 A 1 B -= 1 B 1 C -= 1 C 1 D -= 1 D 1 right_end = max(C, D) right_end max(C, D) max C D S = S[A:right_end+1] S S[A:right_end+1] S A:right_end+1 A right_end+1 right_end 1 ans = True ans True if A < B < C < D:
    if S.count('##'):
        ans = False
elif A < C < B < D:
    if S[A:C+1].count('##') or S[B:D+1].count('##'):
        ans = False
else:
    if S.count('##'):
        ans = False
    elif S[B:D+2].count('...'):
        pass
    elif S[B-1:B+2] == '...':
        pass
    else:
        ans = False A < B < C < D A < B < C A < B A B C D if S.count('##'):
        ans = False S.count('##') S.count S count '##' ans = False ans False elif A < C < B < D:
    if S[A:C+1].count('##') or S[B:D+1].count('##'):
        ans = False A < C < B < D A < C < B A < C A C B D if S[A:C+1].count('##') or S[B:D+1].count('##'):
        ans = False S[A:C+1].count('##') or S[B:D+1].count('##') S[A:C+1].count('##') [A:C+1].count [A:C+1] S A:C+1 A C+1 C 1 count '##' S[B:D+1].count('##') [B:D+1].count [B:D+1] S B:D+1 B D+1 D 1 count '##' ans = False ans False if S.count('##'):
        ans = False
    elif S[B:D+2].count('...'):
        pass
    elif S[B-1:B+2] == '...':
        pass
    else:
        ans = False S.count('##') S.count S count '##' ans = False ans False elif S[B:D+2].count('...'):
        pass
     S[B:D+2].count('...') [B:D+2].count [B:D+2] S B:D+2 B D+2 D 2 count '...' elif S[B-1:B+2] == '...':
        pass
     S[B-1:B+2] == '...' S[B-1:B+2] S B-1:B+2 B-1 B 1 B+2 B 2 '...' ans = False ans False if ans:
    print('Yes')
else:
    print('No')

# print(S)
# print(iwaiwa)
# print(S[B-1:B+2]) ans print('Yes') print 'Yes' print('No') print 'No' A -= 1 1 A D = list(map(int, input().split())) list(map(int, input().split())) D S = S[A:right_end+1] S[A:right_end+1] S B -= 1 1 B A, B, C, D = list(map(int, input().split())) list(map(int, input().split())) A D -= 1 1 D ans = True True ans ans = False False ans C -= 1 1 C ans = False False ans ans = False False ans N, A, B, C, D = list(map(int, input().split())) list(map(int, input().split())) N S = input() input() S right_end = max(C, D) max(C, D) right_end ans = False False ans B, C, D = list(map(int, input().split())) list(map(int, input().split())) B C, D = list(map(int, input().split())) list(map(int, input().split())) C
N, A, B, C, D = list(map(int, input().split()))
S = input()

A -= 1
B -= 1
C -= 1
D -= 1

right_end = max(C, D)
S = S[A:right_end+1]

ans = True
if A < B < C < D:
    if S.count('##'):
        ans = False
elif A < C < B < D:
    if S[A:C+1].count('##') or S[B:D+1].count('##'):
        ans = False
else:
    if S.count('##'):
        ans = False
    elif S[B:D+2].count('...'):
        pass
    elif S[B-1:B+2] == '...':
        pass
    else:
        ans = False

if ans:
    print('Yes')
else:
    print('No')

# print(S)
# print(iwaiwa)
# print(S[B-1:B+2])
