#!/usr/bin/env python3

n, a, b, c, d = [int(x) - 1 for x in input().split()]

s = list(eval(input()))



if d < c:

    s[b] = 'b'

    while a < b:

        if a + 1 <= c and s[a + 1] == '.':

            a += 1

        elif a + 2 <= c and s[a + 2] == '.':

            a += 2

        elif b < d:

            if b + 1 <= d and s[b + 1] == '.':

                s[b] = '.'

                s[b + 1] = 'b'

                b += 1

            elif b + 2 <= d and s[b + 2] == '.':

                s[b] = '.'

                s[b + 2] = 'b'

                b += 2

            else:

                print('No')

                exit()

        else:

            print('No')

            exit()

    a, b = b, a

    c, d = d, c

while b < d:

    if b + 1 <= d and s[b + 1] == '.':

        b += 1

    elif b + 2 <= d and s[b + 2] == '.':

        b += 2

    else:

        print('No')

        exit()

while a < c:

    if a + 1 <= c and s[a + 1] == '.':

        a += 1

    elif a + 2 <= c and s[a + 2] == '.':

        a += 2

    else:

        print('No')

        exit()

print('Yes')

#!/usr/bin/env python3

n, a, b, c, d = [int(x) - 1 for x in input().split()]

s = eval(input())



if d < c:

    f = False

    for i in range(n)[b:d + 1]:

        if '...' in s[i - 1:i + 2]:

            f = True

    if not f:

        print('No')

        exit()

    a, b = b, a

    c, d = d, c

print((['Yes', 'No']['##' in s[a:d + 1]]))

#!/usr/bin/env python3
n, a, b, c, d = [int(x) - 1 for x in input().split()]
s = list(eval(input()))
if d < c:
    s[b] = "b"
    while a < b:
        if a + 1 <= c and s[a + 1] == ".":
            a += 1
        elif a + 2 <= c and s[a + 2] == ".":
            a += 2
        elif b < d:
            if b + 1 <= d and s[b + 1] == ".":
                s[b] = "."
                s[b + 1] = "b"
                b += 1
            elif b + 2 <= d and s[b + 2] == ".":
                s[b] = "."
                s[b + 2] = "b"
                b += 2
            else:
                print("No")
                exit()
        else:
            print("No")
            exit()
    a, b = b, a
    c, d = d, c
while b < d:
    if b + 1 <= d and s[b + 1] == ".":
        b += 1
    elif b + 2 <= d and s[b + 2] == ".":
        b += 2
    else:
        print("No")
        exit()
while a < c:
    if a + 1 <= c and s[a + 1] == ".":
        a += 1
    elif a + 2 <= c and s[a + 2] == ".":
        a += 2
    else:
        print("No")
        exit()
print("Yes")

#!/usr/bin/env python3
n, a, b, c, d = [int(x) - 1 for x in input().split()]
s = eval(input())
if d < c:
    f = False
    for i in range(n)[b : d + 1]:
        if "..." in s[i - 1 : i + 2]:
            f = True
    if not f:
        print("No")
        exit()
    a, b = b, a
    c, d = d, c
print((["Yes", "No"]["##" in s[a : d + 1]]))

-s = list(eval(input())) +s = eval(input()) -    s[b] = "b" -    while a < b: -        if a + 1 <= c and s[a + 1] == ".": -            a += 1 -        elif a + 2 <= c and s[a + 2] == ".": -            a += 2 -        elif b < d: -            if b + 1 <= d and s[b + 1] == ".": -                s[b] = "." -                s[b + 1] = "b" -                b += 1 -            elif b + 2 <= d and s[b + 2] == ".": -                s[b] = "." -                s[b + 2] = "b" -                b += 2 -            else: -                print("No") -                exit() -        else: -            print("No") -            exit() +    f = False +    for i in range(n)[b : d + 1]: +        if "..." in s[i - 1 : i + 2]: +            f = True +    if not f: +        print("No") +        exit() -while b < d: -    if b + 1 <= d and s[b + 1] == ".": -        b += 1 -    elif b + 2 <= d and s[b + 2] == ".": -        b += 2 -    else: -        print("No") -        exit() -while a < c: -    if a + 1 <= c and s[a + 1] == ".": -        a += 1 -    elif a + 2 <= c and s[a + 2] == ".": -        a += 2 -    else: -        print("No") -        exit() -print("Yes") +print((["Yes", "No"]["##" in s[a : d + 1]]))