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 S[max(A, B) - 1: min(C, D) + 2].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 S[max(A, B) - 1: min(C, D) + 2].count('...'):
        return True
    return False canSwitch if S[max(A, B) - 1: min(C, D) + 2].count('...'):
        return True
     S[max(A, B) - 1: min(C, D) + 2].count('...') [max(A, B) - 1: min(C, D) + 2].count [max(A, B) - 1: min(C, D) + 2] S max(A, B) - 1: min(C, D) + 2 max(A, B) - 1 max(A, B) max A B 1 min(C, D) + 2 min(C, D) min C D 2 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' 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 D = map(int, input().split()) map(int, input().split()) D 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 A, B, C, D = map(int, input().split()) map(int, input().split()) A C, D = map(int, input().split()) map(int, input().split()) C def canSwitch():
    if S[max(A, B) - 1: min(C, D) + 2].count('...'):
        return True
    return False def canSwitch():
    if S[max(A, B) - 1: min(C, D) + 2].count('...'):
        return True
    return False canSwitch S = '$' + input() + '$' '$' + input() + '$' S
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 S[max(A, B) - 1: min(C, D) + 2].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')
