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

s = list(eval(input()))

last = ""

for i in range(a, c):

    if last == "#" and s[i] == "#":

        print("No")

        exit()

    last = s[i]

last = ""

for i in range(b, d):

    if last == "#" and s[i] == "#":

        print("No")

        exit()

    last = s[i]

last = ""

if c > d:

    flag = True

    s[b - 1] = "#"

    for i in range(a, c):

        if last == "#" and s[i] == "#":

            flag = False

        last = s[i]

    s[b - 1] = "."

    count = 0

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

        if s[i] == ".":

            count += 1

            if count == 3:

                flag = True

        else:

            count = 0

    if flag:

        print("Yes")

    else:

        print("No")

else:

    print("Yes")

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

s = list(eval(input()))

last = ""

for i in range(a, max(c, d)):

    if last == "#" and s[i] == "#":

        print("No")

        exit()

    last = s[i]

flag = False

if c > d:

    s[b - 1] = "#"

    for i in range(a, c):

        if last == "#" and s[i] == "#":

            flag = True

        last = s[i]

    s[b - 1] = "."

    count = 0

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

        if s[i] == ".":

            count += 1

            if count == 3:

                flag = False

        else:

            count = 0

else:

    for i in range(b, d):

        if last == "#" and s[i] == "#":

            flag = True

        last = s[i]

if not flag:

    print("Yes")

else:

    print("No")

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

n, a, b, c, d = list(map(int, input().split()))
s = list(eval(input()))
last = ""
for i in range(a, max(c, d)):
    if last == "#" and s[i] == "#":
        print("No")
        exit()
    last = s[i]
flag = False
if c > d:
    s[b - 1] = "#"
    for i in range(a, c):
        if last == "#" and s[i] == "#":
            flag = True
        last = s[i]
    s[b - 1] = "."
    count = 0
    for i in range(b - 1, d + 1):
        if s[i] == ".":
            count += 1
            if count == 3:
                flag = False
        else:
            count = 0
else:
    for i in range(b, d):
        if last == "#" and s[i] == "#":
            flag = True
        last = s[i]
if not flag:
    print("Yes")
else:
    print("No")

-for i in range(a, c): +for i in range(a, max(c, d)): -last = "" -for i in range(b, d): -    if last == "#" and s[i] == "#": -        print("No") -        exit() -    last = s[i] -last = "" +flag = False -    flag = True -            flag = False +            flag = True -                flag = True +                flag = False -    if flag: -        print("Yes") -    else: -        print("No") +    for i in range(b, d): +        if last == "#" and s[i] == "#": +            flag = True +        last = s[i] +if not flag: +else: +    print("No")