N, A, B, C, D = map(int, input().split())
S = '$' + input() + '$'

def isOk(fr, to):
    if S[fr: to + 1].count('##') > 0:
        return False
    return True

if not (isOk(A, C) and isOk(C, D)):
    print('No')
    exit()

def canSwitch():
    if A + 1 == B and D < C and S[A: A + 3] == '...':
        return True
    if B + 1 == A and C < D and S[B: B + 3] == '...':
        return True
    if C + 1 == D and B < A and S[C - 1: D + 1] == '...':
        return True
    if D + 1 == C and A < B and S[D - 1: C + 1] == '...':
        return True
    if A < B and S[B - 1: B + 2] == '...':
        return True
    if B < A and S[A - 1: A + 2] == '...':
        return True
    if C < D and S[C - 1: C + 2] == '...':
        return True
    if D < C and S[D - 1: D + 2] == '...':
        return True
    if S[max(A, B): min(C, D) + 1].count('...'):
        return True
    return False

if A < B and D < C or B < A and C < D:
    if not canSwitch():
        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 S = '$' + input() + '$' S '$' + input() + '$' '$' + input() '$' input() input '$' def isOk(fr, to):
    if S[fr: to + 1].count('##') > 0:
        return False
    return True isOk if S[fr: to + 1].count('##') > 0:
        return False
     S[fr: to + 1].count('##') > 0 S[fr: to + 1].count('##') [fr: to + 1].count [fr: to + 1] S fr: to + 1 fr to + 1 to 1 count '##' 0 return False False return True True fr fr to to if not (isOk(A, C) and isOk(C, D)):
    print('No')
    exit() not (isOk(A, C) and isOk(C, D)) isOk(A, C) and isOk(C, D) isOk(A, C) isOk A C isOk(C, D) isOk C D print('No') print 'No' exit() exit def canSwitch():
    if A + 1 == B and D < C and S[A: A + 3] == '...':
        return True
    if B + 1 == A and C < D and S[B: B + 3] == '...':
        return True
    if C + 1 == D and B < A and S[C - 1: D + 1] == '...':
        return True
    if D + 1 == C and A < B and S[D - 1: C + 1] == '...':
        return True
    if A < B and S[B - 1: B + 2] == '...':
        return True
    if B < A and S[A - 1: A + 2] == '...':
        return True
    if C < D and S[C - 1: C + 2] == '...':
        return True
    if D < C and S[D - 1: D + 2] == '...':
        return True
    if S[max(A, B): min(C, D) + 1].count('...'):
        return True
    return False canSwitch if A + 1 == B and D < C and S[A: A + 3] == '...':
        return True
     A + 1 == B and D < C and S[A: A + 3] == '...' A + 1 == B and D < C A + 1 == B A + 1 A 1 B D < C D C S[A: A + 3] == '...' S[A: A + 3] S A: A + 3 A A + 3 A 3 '...' return True True if B + 1 == A and C < D and S[B: B + 3] == '...':
        return True
     B + 1 == A and C < D and S[B: B + 3] == '...' B + 1 == A and C < D B + 1 == A B + 1 B 1 A C < D C D S[B: B + 3] == '...' S[B: B + 3] S B: B + 3 B B + 3 B 3 '...' return True True if C + 1 == D and B < A and S[C - 1: D + 1] == '...':
        return True
     C + 1 == D and B < A and S[C - 1: D + 1] == '...' C + 1 == D and B < A C + 1 == D C + 1 C 1 D B < A B A S[C - 1: D + 1] == '...' S[C - 1: D + 1] S C - 1: D + 1 C - 1 C 1 D + 1 D 1 '...' return True True if D + 1 == C and A < B and S[D - 1: C + 1] == '...':
        return True
     D + 1 == C and A < B and S[D - 1: C + 1] == '...' D + 1 == C and A < B D + 1 == C D + 1 D 1 C A < B A B S[D - 1: C + 1] == '...' S[D - 1: C + 1] S D - 1: C + 1 D - 1 D 1 C + 1 C 1 '...' return True True if A < B and S[B - 1: B + 2] == '...':
        return True
     A < B and S[B - 1: B + 2] == '...' A < B A B S[B - 1: B + 2] == '...' S[B - 1: B + 2] S B - 1: B + 2 B - 1 B 1 B + 2 B 2 '...' return True True if B < A and S[A - 1: A + 2] == '...':
        return True
     B < A and S[A - 1: A + 2] == '...' B < A B A S[A - 1: A + 2] == '...' S[A - 1: A + 2] S A - 1: A + 2 A - 1 A 1 A + 2 A 2 '...' return True True if C < D and S[C - 1: C + 2] == '...':
        return True
     C < D and S[C - 1: C + 2] == '...' C < D C D S[C - 1: C + 2] == '...' S[C - 1: C + 2] S C - 1: C + 2 C - 1 C 1 C + 2 C 2 '...' return True True if D < C and S[D - 1: D + 2] == '...':
        return True
     D < C and S[D - 1: D + 2] == '...' D < C D C S[D - 1: D + 2] == '...' S[D - 1: D + 2] S D - 1: D + 2 D - 1 D 1 D + 2 D 2 '...' return True True if S[max(A, B): min(C, D) + 1].count('...'):
        return True
     S[max(A, B): min(C, D) + 1].count('...') [max(A, B): min(C, D) + 1].count [max(A, B): min(C, D) + 1] S max(A, B): min(C, D) + 1 max(A, B) max A B min(C, D) + 1 min(C, D) min C D 1 count '...' return True True return False False if A < B and D < C or B < A and C < D:
    if not canSwitch():
        print('No')
        exit() A < B and D < C or B < A and C < D A < B and D < C A < B A B D < C D C B < A and C < D B < A B A C < D C D if not canSwitch():
        print('No')
        exit() not canSwitch() canSwitch() canSwitch print('No') print 'No' exit() exit print('Yes') print 'Yes' A, B, C, D = map(int, input().split()) map(int, input().split()) A def isOk(fr, to):
    if S[fr: to + 1].count('##') > 0:
        return False
    return True def isOk(fr, to):
    if S[fr: to + 1].count('##') > 0:
        return False
    return True isOk def canSwitch():
    if A + 1 == B and D < C and S[A: A + 3] == '...':
        return True
    if B + 1 == A and C < D and S[B: B + 3] == '...':
        return True
    if C + 1 == D and B < A and S[C - 1: D + 1] == '...':
        return True
    if D + 1 == C and A < B and S[D - 1: C + 1] == '...':
        return True
    if A < B and S[B - 1: B + 2] == '...':
        return True
    if B < A and S[A - 1: A + 2] == '...':
        return True
    if C < D and S[C - 1: C + 2] == '...':
        return True
    if D < C and S[D - 1: D + 2] == '...':
        return True
    if S[max(A, B): min(C, D) + 1].count('...'):
        return True
    return False def canSwitch():
    if A + 1 == B and D < C and S[A: A + 3] == '...':
        return True
    if B + 1 == A and C < D and S[B: B + 3] == '...':
        return True
    if C + 1 == D and B < A and S[C - 1: D + 1] == '...':
        return True
    if D + 1 == C and A < B and S[D - 1: C + 1] == '...':
        return True
    if A < B and S[B - 1: B + 2] == '...':
        return True
    if B < A and S[A - 1: A + 2] == '...':
        return True
    if C < D and S[C - 1: C + 2] == '...':
        return True
    if D < C and S[D - 1: D + 2] == '...':
        return True
    if S[max(A, B): min(C, D) + 1].count('...'):
        return True
    return False canSwitch C, D = map(int, input().split()) map(int, input().split()) C B, C, D = map(int, input().split()) map(int, input().split()) B N, A, B, C, D = map(int, input().split()) map(int, input().split()) N S = '$' + input() + '$' '$' + input() + '$' S D = map(int, input().split()) map(int, input().split()) D
N, A, B, C, D = map(int, input().split())
S = '$' + input() + '$'

def isOk(fr, to):
    if S[fr: to + 1].count('##') > 0:
        return False
    return True

if not (isOk(A, C) and isOk(C, D)):
    print('No')
    exit()

def canSwitch():
    if A + 1 == B and D < C and S[A: A + 3] == '...':
        return True
    if B + 1 == A and C < D and S[B: B + 3] == '...':
        return True
    if C + 1 == D and B < A and S[C - 1: D + 1] == '...':
        return True
    if D + 1 == C and A < B and S[D - 1: C + 1] == '...':
        return True
    if A < B and S[B - 1: B + 2] == '...':
        return True
    if B < A and S[A - 1: A + 2] == '...':
        return True
    if C < D and S[C - 1: C + 2] == '...':
        return True
    if D < C and S[D - 1: D + 2] == '...':
        return True
    if S[max(A, B): min(C, D) + 1].count('...'):
        return True
    return False

if A < B and D < C or B < A and C < D:
    if not canSwitch():
        print('No')
        exit()

print('Yes')
