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

A -= 1

B -= 1

C -= 1

D -= 1



s = eval(input())



for i in range(A + 1, C - 2 + 1):

    if s[i] == '#' and s[i + 1] == '#':

        print('No')

        exit()

for i in range(B + 1, D - 2 + 1):

    if s[i] == '#' and s[i + 1] == '#':

        print('No')

        exit()



if A < C < B < D:

    # ふぬけとすぬけは独立

    # 先にふぬけ(B,D)から処理

    print('Yes')

    exit()

elif A < B < C < D:

    # ふぬけから移動させる

    print('Yes')

    exit()

else:

    # A < B < D < C:

    # すぬけから移動させる

    # 3連続空欄が必要で

    # boo

    # obo

    # ならOK

    # oDoまでOKで、ooDはダメ

    for i in range(B - 1, D - 1 + 1):

        # 連続3マスの起点マス

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

            print('Yes')

            exit()

print('No')

def solve():

    if '##' in s[a:c + 1] or '##' in s[b:d + 1]:

        return False

    if b < c < d:

        return True  # sfsf

    if c < b < d:

        return True  # ssff

    return '...' in s[b - 1:d + 2]  # sffs





n, a, b, c, d = list(map(int, input().split()))

a -= 1

b -= 1

c -= 1

d -= 1



s = eval(input())



print(('Yes' if solve() else 'No'))

N, A, B, C, D = list(map(int, input().split()))
A -= 1
B -= 1
C -= 1
D -= 1
s = eval(input())
for i in range(A + 1, C - 2 + 1):
    if s[i] == "#" and s[i + 1] == "#":
        print("No")
        exit()
for i in range(B + 1, D - 2 + 1):
    if s[i] == "#" and s[i + 1] == "#":
        print("No")
        exit()
if A < C < B < D:
    # ふぬけとすぬけは独立
    # 先にふぬけ(B,D)から処理
    print("Yes")
    exit()
elif A < B < C < D:
    # ふぬけから移動させる
    print("Yes")
    exit()
else:
    # A < B < D < C:
    # すぬけから移動させる
    # 3連続空欄が必要で
    # boo
    # obo
    # ならOK
    # oDoまでOKで、ooDはダメ
    for i in range(B - 1, D - 1 + 1):
        # 連続3マスの起点マス
        if s[i] == "." and s[i + 1] == "." and s[i + 2] == ".":
            print("Yes")
            exit()
print("No")

def solve():
    if "##" in s[a : c + 1] or "##" in s[b : d + 1]:
        return False
    if b < c < d:
        return True  # sfsf
    if c < b < d:
        return True  # ssff
    return "..." in s[b - 1 : d + 2]  # sffs


n, a, b, c, d = list(map(int, input().split()))
a -= 1
b -= 1
c -= 1
d -= 1
s = eval(input())
print(("Yes" if solve() else "No"))

-N, A, B, C, D = list(map(int, input().split())) -A -= 1 -B -= 1 -C -= 1 -D -= 1 +def solve(): +    if "##" in s[a : c + 1] or "##" in s[b : d + 1]: +        return False +    if b < c < d: +        return True  # sfsf +    if c < b < d: +        return True  # ssff +    return "..." in s[b - 1 : d + 2]  # sffs + + +n, a, b, c, d = list(map(int, input().split())) +a -= 1 +b -= 1 +c -= 1 +d -= 1 -for i in range(A + 1, C - 2 + 1): -    if s[i] == "#" and s[i + 1] == "#": -        print("No") -        exit() -for i in range(B + 1, D - 2 + 1): -    if s[i] == "#" and s[i + 1] == "#": -        print("No") -        exit() -if A < C < B < D: -    # ふぬけとすぬけは独立 -    # 先にふぬけ(B,D)から処理 -    print("Yes") -    exit() -elif A < B < C < D: -    # ふぬけから移動させる -    print("Yes") -    exit() -else: -    # A < B < D < C: -    # すぬけから移動させる -    # 3連続空欄が必要で -    # boo -    # obo -    # ならOK -    # oDoまでOKで、ooDはダメ -    for i in range(B - 1, D - 1 + 1): -        # 連続3マスの起点マス -        if s[i] == "." and s[i + 1] == "." and s[i + 2] == ".": -            print("Yes") -            exit() -print("No") +print(("Yes" if solve() else "No"))