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

def solve(E, x, y, G):
    if y != -1:
        E[y-1] = '#'
    dp = [0]*N
    dp[x-1] = 1
    for i in range(2, N):
        if dp[i-2] or dp[i-1]:
            if E[i] == '.':
                dp[i] = 1
    # print(dp)
    return dp[G-1]

if C < D:
    p = solve(S, B, -1, D)
    q = solve(S, A, -1, C)
else:
    bla = 0
    idx = -1
    for i in range(B-2, N):
        if S[i] == '.':
            bla += 1
        else:
            bla = 0
        if bla == 3:
            idx = i
            break
    # print(idx)
    if idx == -1:
        print('No')
        exit()
    else:
        if D - 1 <= idx - 2:
            print('No')
            exit()

    p = solve(S, A, -1, C)
    q = solve(S, B, -1, D)
    # print(p, q)

if p and q:
    print('Yes')
else:
    print('No') 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 = list(input()) S list(input()) list input() input def solve(E, x, y, G):
    if y != -1:
        E[y-1] = '#'
    dp = [0]*N
    dp[x-1] = 1
    for i in range(2, N):
        if dp[i-2] or dp[i-1]:
            if E[i] == '.':
                dp[i] = 1
    # print(dp)
    return dp[G-1] solve if y != -1:
        E[y-1] = '#'
     y != -1 y -1 E[y-1] = '#' E[y-1] E y-1 y 1 '#' dp = [0]*N dp [0]*N [0] 0 N dp[x-1] = 1 dp[x-1] dp x-1 x 1 1 for i in range(2, N):
        if dp[i-2] or dp[i-1]:
            if E[i] == '.':
                dp[i] = 1
    # print(dp)
     i range(2, N) range 2 N if dp[i-2] or dp[i-1]:
            if E[i] == '.':
                dp[i] = 1
    # print(dp)
     dp[i-2] or dp[i-1] dp[i-2] dp i-2 i 2 dp[i-1] dp i-1 i 1 if E[i] == '.':
                dp[i] = 1
    # print(dp)
     E[i] == '.' E[i] E i '.' dp[i] = 1 dp[i] dp i 1 return dp[G-1] dp[G-1] dp G-1 G 1 E E x x y y G G if C < D:
    p = solve(S, B, -1, D)
    q = solve(S, A, -1, C)
else:
    bla = 0
    idx = -1
    for i in range(B-2, N):
        if S[i] == '.':
            bla += 1
        else:
            bla = 0
        if bla == 3:
            idx = i
            break
    # print(idx)
    if idx == -1:
        print('No')
        exit()
    else:
        if D - 1 <= idx - 2:
            print('No')
            exit()

    p = solve(S, A, -1, C)
    q = solve(S, B, -1, D)
    # print(p, q) C < D C D p = solve(S, B, -1, D) p solve(S, B, -1, D) solve S B -1 D q = solve(S, A, -1, C) q solve(S, A, -1, C) solve S A -1 C bla = 0 bla 0 idx = -1 idx -1 for i in range(B-2, N):
        if S[i] == '.':
            bla += 1
        else:
            bla = 0
        if bla == 3:
            idx = i
            break
    # print(idx)
     i range(B-2, N) range B-2 B 2 N if S[i] == '.':
            bla += 1
        else:
            bla = 0
         S[i] == '.' S[i] S i '.' bla += 1 bla 1 bla = 0 bla 0 if bla == 3:
            idx = i
            break
    # print(idx)
     bla == 3 bla 3 idx = i idx i break if idx == -1:
        print('No')
        exit()
    else:
        if D - 1 <= idx - 2:
            print('No')
            exit()

     idx == -1 idx -1 print('No') print 'No' exit() exit if D - 1 <= idx - 2:
            print('No')
            exit()

     D - 1 <= idx - 2 D - 1 D 1 idx - 2 idx 2 print('No') print 'No' exit() exit p = solve(S, A, -1, C) p solve(S, A, -1, C) solve S A -1 C q = solve(S, B, -1, D) q solve(S, B, -1, D) solve S B -1 D if p and q:
    print('Yes')
else:
    print('No') p and q p q print('Yes') print 'Yes' print('No') print 'No' p = solve(S, B, -1, D) solve(S, B, -1, D) p S = list(input()) list(input()) S N, A, B, C, D = map(int, input().split()) map(int, input().split()) N A, B, C, D = map(int, input().split()) map(int, input().split()) A bla += 1 1 bla C, D = map(int, input().split()) map(int, input().split()) C q = solve(S, B, -1, D) solve(S, B, -1, D) q bla = 0 0 bla q = solve(S, A, -1, C) solve(S, A, -1, C) q D = map(int, input().split()) map(int, input().split()) D p = solve(S, A, -1, C) solve(S, A, -1, C) p idx = -1 -1 idx idx = i i idx def solve(E, x, y, G):
    if y != -1:
        E[y-1] = '#'
    dp = [0]*N
    dp[x-1] = 1
    for i in range(2, N):
        if dp[i-2] or dp[i-1]:
            if E[i] == '.':
                dp[i] = 1
    # print(dp)
    return dp[G-1] def solve(E, x, y, G):
    if y != -1:
        E[y-1] = '#'
    dp = [0]*N
    dp[x-1] = 1
    for i in range(2, N):
        if dp[i-2] or dp[i-1]:
            if E[i] == '.':
                dp[i] = 1
    # print(dp)
    return dp[G-1] solve B, C, D = map(int, input().split()) map(int, input().split()) B bla = 0 0 bla
N, A, B, C, D = map(int, input().split())
S = list(input())

def solve(E, x, y, G):
    if y != -1:
        E[y-1] = '#'
    dp = [0]*N
    dp[x-1] = 1
    for i in range(2, N):
        if dp[i-2] or dp[i-1]:
            if E[i] == '.':
                dp[i] = 1
    # print(dp)
    return dp[G-1]

if C < D:
    p = solve(S, B, -1, D)
    q = solve(S, A, -1, C)
else:
    bla = 0
    idx = -1
    for i in range(B-2, N):
        if S[i] == '.':
            bla += 1
        else:
            bla = 0
        if bla == 3:
            idx = i
            break
    # print(idx)
    if idx == -1:
        print('No')
        exit()
    else:
        if D - 1 <= idx - 2:
            print('No')
            exit()

    p = solve(S, A, -1, C)
    q = solve(S, B, -1, D)
    # print(p, q)

if p and q:
    print('Yes')
else:
    print('No')