N,A,B,C,D = list(map(int,input().split()))
A -= 1
B -= 1
C -= 1
D -= 1
S = input()
if S[C] == '#' or S[D] == '#':
    print('No')
    exit()
if C<D:
    LA = S[A:C+1]
    LB = S[B:D+1]
    if LA.count('##') > 0 or LB.count('##') > 0:
        print('No')
        exit()
if C>D:
    LA = S[A:D+1]
    LB = S[B:C+1]
    if LA.count('##') > 0 or LB.count('##') > 0 or LA.count('...') == 0:
        print('No')
        exit()
print('Yes')
