n, a, b, c, d = map(int, input().split())
a -= 1
b -= 1
c -= 1
d -= 1
S = input()

if c < d:
    while b < d:
        if S[b+1] == '.':
            b += 1
        elif b+2 <= d and S[b+2] == '.':
            b += 2
        else:
            print('No')
            exit()
    while a < c:
        if S[a+1] == '.':
            a += 1
        elif a+2 <= c and S[a+2] == '.':
            a += 2
        else:
            print('No')
            exit()
else:
    while a < c:
        if a+1 == b and S[a+2] == '.' :
            a += 2
        elif a+1 == b and a+3 <= d and S[a+3] == '.':
            b += 2
            a += 1
        elif S[a+1] == '.' and a+1 != b:
            a += 1
        elif a+2 == b and a+3 <= d and S[a+3] == '.':
            a += 2
            b += 1
        elif a+2 == b and a+4 <= d and S[a+4] == '.':
            a += 2
            b += 2
        elif S[a+2] == '.' and a+2 != b:
            a += 2
        else:
            print('No')
            exit()
    while b < d:
        if S[b+1] == '.':
            b += 1
        elif b+2 <= d and S[b+2] == '.':
            b += 2
        else:
            print('No')
            exit()
print('Yes') 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 a -= 1 a 1 b -= 1 b 1 c -= 1 c 1 d -= 1 d 1 S = input() S input() input if c < d:
    while b < d:
        if S[b+1] == '.':
            b += 1
        elif b+2 <= d and S[b+2] == '.':
            b += 2
        else:
            print('No')
            exit()
    while a < c:
        if S[a+1] == '.':
            a += 1
        elif a+2 <= c and S[a+2] == '.':
            a += 2
        else:
            print('No')
            exit()
else:
    while a < c:
        if a+1 == b and S[a+2] == '.' :
            a += 2
        elif a+1 == b and a+3 <= d and S[a+3] == '.':
            b += 2
            a += 1
        elif S[a+1] == '.' and a+1 != b:
            a += 1
        elif a+2 == b and a+3 <= d and S[a+3] == '.':
            a += 2
            b += 1
        elif a+2 == b and a+4 <= d and S[a+4] == '.':
            a += 2
            b += 2
        elif S[a+2] == '.' and a+2 != b:
            a += 2
        else:
            print('No')
            exit()
    while b < d:
        if S[b+1] == '.':
            b += 1
        elif b+2 <= d and S[b+2] == '.':
            b += 2
        else:
            print('No')
            exit() c < d c d while b < d:
        if S[b+1] == '.':
            b += 1
        elif b+2 <= d and S[b+2] == '.':
            b += 2
        else:
            print('No')
            exit()
     b < d b d if S[b+1] == '.':
            b += 1
        elif b+2 <= d and S[b+2] == '.':
            b += 2
        else:
            print('No')
            exit()
     S[b+1] == '.' S[b+1] S b+1 b 1 '.' b += 1 b 1 elif b+2 <= d and S[b+2] == '.':
            b += 2
         b+2 <= d and S[b+2] == '.' b+2 <= d b+2 b 2 d S[b+2] == '.' S[b+2] S b+2 b 2 '.' b += 2 b 2 print('No') print 'No' exit() exit while a < c:
        if S[a+1] == '.':
            a += 1
        elif a+2 <= c and S[a+2] == '.':
            a += 2
        else:
            print('No')
            exit() a < c a c if S[a+1] == '.':
            a += 1
        elif a+2 <= c and S[a+2] == '.':
            a += 2
        else:
            print('No')
            exit() S[a+1] == '.' S[a+1] S a+1 a 1 '.' a += 1 a 1 elif a+2 <= c and S[a+2] == '.':
            a += 2
         a+2 <= c and S[a+2] == '.' a+2 <= c a+2 a 2 c S[a+2] == '.' S[a+2] S a+2 a 2 '.' a += 2 a 2 print('No') print 'No' exit() exit while a < c:
        if a+1 == b and S[a+2] == '.' :
            a += 2
        elif a+1 == b and a+3 <= d and S[a+3] == '.':
            b += 2
            a += 1
        elif S[a+1] == '.' and a+1 != b:
            a += 1
        elif a+2 == b and a+3 <= d and S[a+3] == '.':
            a += 2
            b += 1
        elif a+2 == b and a+4 <= d and S[a+4] == '.':
            a += 2
            b += 2
        elif S[a+2] == '.' and a+2 != b:
            a += 2
        else:
            print('No')
            exit()
     a < c a c if a+1 == b and S[a+2] == '.' :
            a += 2
        elif a+1 == b and a+3 <= d and S[a+3] == '.':
            b += 2
            a += 1
        elif S[a+1] == '.' and a+1 != b:
            a += 1
        elif a+2 == b and a+3 <= d and S[a+3] == '.':
            a += 2
            b += 1
        elif a+2 == b and a+4 <= d and S[a+4] == '.':
            a += 2
            b += 2
        elif S[a+2] == '.' and a+2 != b:
            a += 2
        else:
            print('No')
            exit()
     a+1 == b and S[a+2] == '.' a+1 == b a+1 a 1 b S[a+2] == '.' S[a+2] S a+2 a 2 '.' a += 2 a 2 elif a+1 == b and a+3 <= d and S[a+3] == '.':
            b += 2
            a += 1
         a+1 == b and a+3 <= d and S[a+3] == '.' a+1 == b and a+3 <= d a+1 == b a+1 a 1 b a+3 <= d a+3 a 3 d S[a+3] == '.' S[a+3] S a+3 a 3 '.' b += 2 b 2 a += 1 a 1 elif S[a+1] == '.' and a+1 != b:
            a += 1
         S[a+1] == '.' and a+1 != b S[a+1] == '.' S[a+1] S a+1 a 1 '.' a+1 != b a+1 a 1 b a += 1 a 1 elif a+2 == b and a+3 <= d and S[a+3] == '.':
            a += 2
            b += 1
         a+2 == b and a+3 <= d and S[a+3] == '.' a+2 == b and a+3 <= d a+2 == b a+2 a 2 b a+3 <= d a+3 a 3 d S[a+3] == '.' S[a+3] S a+3 a 3 '.' a += 2 a 2 b += 1 b 1 elif a+2 == b and a+4 <= d and S[a+4] == '.':
            a += 2
            b += 2
         a+2 == b and a+4 <= d and S[a+4] == '.' a+2 == b and a+4 <= d a+2 == b a+2 a 2 b a+4 <= d a+4 a 4 d S[a+4] == '.' S[a+4] S a+4 a 4 '.' a += 2 a 2 b += 2 b 2 elif S[a+2] == '.' and a+2 != b:
            a += 2
         S[a+2] == '.' and a+2 != b S[a+2] == '.' S[a+2] S a+2 a 2 '.' a+2 != b a+2 a 2 b a += 2 a 2 print('No') print 'No' exit() exit while b < d:
        if S[b+1] == '.':
            b += 1
        elif b+2 <= d and S[b+2] == '.':
            b += 2
        else:
            print('No')
            exit() b < d b d if S[b+1] == '.':
            b += 1
        elif b+2 <= d and S[b+2] == '.':
            b += 2
        else:
            print('No')
            exit() S[b+1] == '.' S[b+1] S b+1 b 1 '.' b += 1 b 1 elif b+2 <= d and S[b+2] == '.':
            b += 2
         b+2 <= d and S[b+2] == '.' b+2 <= d b+2 b 2 d S[b+2] == '.' S[b+2] S b+2 b 2 '.' b += 2 b 2 print('No') print 'No' exit() exit print('Yes') print 'Yes' n, a, b, c, d = map(int, input().split()) map(int, input().split()) n b += 2 2 b a -= 1 1 a a += 1 1 a a += 2 2 a a += 2 2 a c -= 1 1 c a += 1 1 a a += 2 2 a b -= 1 1 b c, d = map(int, input().split()) map(int, input().split()) c S = input() input() S a += 1 1 a b, c, d = map(int, input().split()) map(int, input().split()) b b += 1 1 b b += 1 1 b a, b, c, d = map(int, input().split()) map(int, input().split()) a b += 1 1 b a += 2 2 a b += 2 2 b a += 2 2 a d -= 1 1 d b += 2 2 b b += 2 2 b d = map(int, input().split()) map(int, input().split()) d
n, a, b, c, d = map(int, input().split())
a -= 1
b -= 1
c -= 1
d -= 1
S = input()

if c < d:
    while b < d:
        if S[b+1] == '.':
            b += 1
        elif b+2 <= d and S[b+2] == '.':
            b += 2
        else:
            print('No')
            exit()
    while a < c:
        if S[a+1] == '.':
            a += 1
        elif a+2 <= c and S[a+2] == '.':
            a += 2
        else:
            print('No')
            exit()
else:
    while a < c:
        if a+1 == b and S[a+2] == '.' :
            a += 2
        elif a+1 == b and a+3 <= d and S[a+3] == '.':
            b += 2
            a += 1
        elif S[a+1] == '.' and a+1 != b:
            a += 1
        elif a+2 == b and a+3 <= d and S[a+3] == '.':
            a += 2
            b += 1
        elif a+2 == b and a+4 <= d and S[a+4] == '.':
            a += 2
            b += 2
        elif S[a+2] == '.' and a+2 != b:
            a += 2
        else:
            print('No')
            exit()
    while b < d:
        if S[b+1] == '.':
            b += 1
        elif b+2 <= d and S[b+2] == '.':
            b += 2
        else:
            print('No')
            exit()
print('Yes')