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

s = eval(input())



a -= 1

b -= 1

c -= 1

d -= 1



s += '#'



flg = True

ok = False

cnt = 0

for i in range(b, d):

    if s[i] == '#':

        cnt = 0

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

            flg = False

    else:

        cnt += 1

        if cnt == 3:

            ok = True     

if cnt + 1 == 3:

    ok = True



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

    ok = True



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

    ok = True



for i in range(a, c):

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

        flg = False



if c < d:

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



else:

    print(('Yes' if flg and ok else 'No'))

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

s = eval(input())



s = '#' + s + '#'



def can_reach(start, end):

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

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

            return False

    return True



if not can_reach(a, b) or not can_reach(b, d):

    print('No')

    exit()



if c > d:

    can_over = False

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

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

            can_over = True

    if not can_over:

        print('No')

        exit()



print('Yes')

n, a, b, c, d = list(map(int, input().split()))
s = eval(input())
a -= 1
b -= 1
c -= 1
d -= 1
s += "#"
flg = True
ok = False
cnt = 0
for i in range(b, d):
    if s[i] == "#":
        cnt = 0
        if s[i + 1] == "#":
            flg = False
    else:
        cnt += 1
        if cnt == 3:
            ok = True
if cnt + 1 == 3:
    ok = True
if s[b - 1] == "." and s[b] == "." and s[b + 1] == ".":
    ok = True
if s[d - 1] == "." and s[d] == "." and s[d + 1] == ".":
    ok = True
for i in range(a, c):
    if s[i] == "#" and s[i + 1] == "#":
        flg = False
if c < d:
    print(("Yes" if flg else "No"))
else:
    print(("Yes" if flg and ok else "No"))

n, a, b, c, d = list(map(int, input().split()))
s = eval(input())
s = "#" + s + "#"


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


if not can_reach(a, b) or not can_reach(b, d):
    print("No")
    exit()
if c > d:
    can_over = False
    for i in range(b, d + 1):
        if s[i - 1] == "." and s[i] == "." and s[i + 1] == ".":
            can_over = True
    if not can_over:
        print("No")
        exit()
print("Yes")

-a -= 1 -b -= 1 -c -= 1 -d -= 1 -s += "#" -flg = True -ok = False -cnt = 0 -for i in range(b, d): -    if s[i] == "#": -        cnt = 0 -        if s[i + 1] == "#": -            flg = False -    else: -        cnt += 1 -        if cnt == 3: -            ok = True -if cnt + 1 == 3: -    ok = True -if s[b - 1] == "." and s[b] == "." and s[b + 1] == ".": -    ok = True -if s[d - 1] == "." and s[d] == "." and s[d + 1] == ".": -    ok = True -for i in range(a, c): -    if s[i] == "#" and s[i + 1] == "#": -        flg = False -if c < d: -    print(("Yes" if flg else "No")) -else: -    print(("Yes" if flg and ok else "No")) +s = "#" + s + "#" + + +def can_reach(start, end): +    for i in range(start, end + 1): +        if s[i] == "#" and s[i + 1] == "#": +            return False +    return True + + +if not can_reach(a, b) or not can_reach(b, d): +    print("No") +    exit() +if c > d: +    can_over = False +    for i in range(b, d + 1): +        if s[i - 1] == "." and s[i] == "." and s[i + 1] == ".": +            can_over = True +    if not can_over: +        print("No") +        exit() +print("Yes")