import sys

sys.setrecursionlimit(100000000)

 

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

s = list(eval(input()))

 

A -= 1

B -= 1

C -= 1

D -= 1

 

for i in range(len(s)):

    if i == len(s) - 1:

        continue

    else:

        if s[i] == '#' and s[i+1] == '#' and max(C, D) < i and i <= C:

            print("No")

            exit()

 

if D < C:

    tmp = 0

    for i in range(len(s)):

        if i == len(s) - 2 or i == len(s) - 1:

            continue

        else:

            if s[i] == '.' and s[i+1] == '.' and s[i+2] == '.' and B <= i + 1 <= D:

                tmp = 1

    if tmp != 1:

        print("No")

        exit()

 

 

 

def check(s, start, goal, ans):

    if start == goal:

        return 1

    if s[start] == '#':

        return 0

    if start + 1 <= N - 1:

        ans += check(s, start + 1, goal, ans)

    if start + 2 <= N - 1:

        ans += check(s, start + 2, goal, ans)

    return ans

 

ans = 0

if not check(s, B, D, ans):

    print("No")

    exit()

#s[D] = '#'

if not check(s, A, C, ans):

    print("No")

    exit()

print("Yes")
import sys

sys.setrecursionlimit(100000000)

 

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

s = list(eval(input()))

 

A -= 1

B -= 1

C -= 1

D -= 1

 



if D < C:

    tmp = 0

    for i in range(len(s)):

        if i == len(s) - 2 or i == len(s) - 1:

            continue

        else:

            if s[i] == '.' and s[i+1] == '.' and s[i+2] == '.' and B <= i + 1 <= D:

                tmp = 1

    if tmp != 1:

        print("No")

        exit()

 

 

 

def check(s, start, goal, ans):

    if start == goal:

        return 1

    if s[start] == '#':

        return 0

    if start + 1 <= N - 1:

        ans += check(s, start + 1, goal, ans)

    if start + 2 <= N - 1:

        ans += check(s, start + 2, goal, ans)

    return ans

 

ans = 0

if not check(s, B, D, ans):

    print("No")

    exit()

#s[D] = '#'

if not check(s, A, C, ans):

    print("No")

    exit()

print("Yes")
import sys

sys.setrecursionlimit(100000000)
N, A, B, C, D = list(map(int, input().split()))
s = list(eval(input()))
A -= 1
B -= 1
C -= 1
D -= 1
for i in range(len(s)):
    if i == len(s) - 1:
        continue
    else:
        if s[i] == "#" and s[i + 1] == "#" and max(C, D) < i and i <= C:
            print("No")
            exit()
if D < C:
    tmp = 0
    for i in range(len(s)):
        if i == len(s) - 2 or i == len(s) - 1:
            continue
        else:
            if s[i] == "." and s[i + 1] == "." and s[i + 2] == "." and B <= i + 1 <= D:
                tmp = 1
    if tmp != 1:
        print("No")
        exit()


def check(s, start, goal, ans):
    if start == goal:
        return 1
    if s[start] == "#":
        return 0
    if start + 1 <= N - 1:
        ans += check(s, start + 1, goal, ans)
    if start + 2 <= N - 1:
        ans += check(s, start + 2, goal, ans)
    return ans


ans = 0
if not check(s, B, D, ans):
    print("No")
    exit()
# s[D] = '#'
if not check(s, A, C, ans):
    print("No")
    exit()
print("Yes")

import sys

sys.setrecursionlimit(100000000)
N, A, B, C, D = list(map(int, input().split()))
s = list(eval(input()))
A -= 1
B -= 1
C -= 1
D -= 1
if D < C:
    tmp = 0
    for i in range(len(s)):
        if i == len(s) - 2 or i == len(s) - 1:
            continue
        else:
            if s[i] == "." and s[i + 1] == "." and s[i + 2] == "." and B <= i + 1 <= D:
                tmp = 1
    if tmp != 1:
        print("No")
        exit()


def check(s, start, goal, ans):
    if start == goal:
        return 1
    if s[start] == "#":
        return 0
    if start + 1 <= N - 1:
        ans += check(s, start + 1, goal, ans)
    if start + 2 <= N - 1:
        ans += check(s, start + 2, goal, ans)
    return ans


ans = 0
if not check(s, B, D, ans):
    print("No")
    exit()
# s[D] = '#'
if not check(s, A, C, ans):
    print("No")
    exit()
print("Yes")

-for i in range(len(s)): -    if i == len(s) - 1: -        continue -    else: -        if s[i] == "#" and s[i + 1] == "#" and max(C, D) < i and i <= C: -            print("No") -            exit()