def iwa_check(start, end):

    for i in range(start, end):

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

            return False

    return True





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

s = list(eval(input()))

s = ['#'] + s + ['#']



# 岩が2個並ぶ

if not iwa_check(a, c) or not iwa_check(b, d):

    print('No')

    exit()



# 追い越す場合

if c > d:

    ok = False

    for i in range(b, d + 1):

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

            ok = True

            break

    if not ok:

        print('No')

        exit()



# 追い越さない

print('Yes')

def check(start, end):

    for i in range(start, end - 1):

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

            return False

    return True





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

s = eval(input())

s = '#' + s + '#'



# a~c,b~d間で岩2連続は無理

if not check(a, c) or not check(b, d):

    print('No')

    exit()



# d<cなら飛び越え必要=b~d区間に3マス連続空きが必要

if d < c:

    for i in range(b, d + 1):

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

            print('Yes')

            exit()

    print('No')

else:

    print('Yes')

def iwa_check(start, end):
    for i in range(start, end):
        if s[i] == "#" and s[i + 1] == "#":
            return False
    return True


n, a, b, c, d = list(map(int, input().split()))
s = list(eval(input()))
s = ["#"] + s + ["#"]
# 岩が2個並ぶ
if not iwa_check(a, c) or not iwa_check(b, d):
    print("No")
    exit()
# 追い越す場合
if c > d:
    ok = False
    for i in range(b, d + 1):
        if s[i - 1] == "." and s[i] == "." and s[i + 1] == ".":
            ok = True
            break
    if not ok:
        print("No")
        exit()
# 追い越さない
print("Yes")

def check(start, end):
    for i in range(start, end - 1):
        if s[i] == "#" and s[i + 1] == "#":
            return False
    return True


n, a, b, c, d = list(map(int, input().split()))
s = eval(input())
s = "#" + s + "#"
# a~c,b~d間で岩2連続は無理
if not check(a, c) or not check(b, d):
    print("No")
    exit()
# d<cなら飛び越え必要=b~d区間に3マス連続空きが必要
if d < c:
    for i in range(b, d + 1):
        if s[i - 1] == "." and s[i] == "." and s[i + 1] == ".":
            print("Yes")
            exit()
    print("No")
else:
    print("Yes")

-def iwa_check(start, end): -    for i in range(start, end): +def check(start, end): +    for i in range(start, end - 1): -s = list(eval(input())) -s = ["#"] + s + ["#"] -# 岩が2個並ぶ -if not iwa_check(a, c) or not iwa_check(b, d): +s = eval(input()) +s = "#" + s + "#" +# a~c,b~d間で岩2連続は無理 +if not check(a, c) or not check(b, d): -# 追い越す場合 -if c > d: -    ok = False +# d<cなら飛び越え必要=b~d区間に3マス連続空きが必要 +if d < c: -            ok = True -            break -    if not ok: -        print("No") -        exit() -# 追い越さない -print("Yes") +            print("Yes") +            exit() +    print("No") +else: +    print("Yes")