import sys

import numpy as np





def main():

    n, a, b, c, d = [int(x) for x in input().split()]

    a -= 1

    b -= 1

    c -= 1

    d -= 1

    nv = np.insert(np.array([1 if char == '#' else 0 for char in eval(input())]).cumsum(), 0, 0)

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

        if nv[i + 2] - nv[i] == 2:

            print("No")

            sys.exit()

    if c < d:

        print("Yes")

        sys.exit()

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

        if nv[i + 2] - nv[i - 1] == 0:

            print("Yes")

            sys.exit()

    print("No")





main()

import sys

import numpy as np





def main():

    n, a, b, c, d = [int(x) for x in input().split()]

    nv = np.insert(np.array([1 if char == '#' else 0 for char in eval(input())]), 0, 0)

    nv1 = nv[1:] + nv[:-1]

    nv2 = nv[2:] + nv[1:-1] + nv[:-2]

    if np.any(nv1[a:max(c, d)] == 2):

        print("No")

    elif c < d:

        print("Yes")

    elif np.any(nv2[b-1:d] == 0):

        print("Yes")

    else:

        print("No")





main()

import sys
import numpy as np


def main():
    n, a, b, c, d = [int(x) for x in input().split()]
    a -= 1
    b -= 1
    c -= 1
    d -= 1
    nv = np.insert(
        np.array([1 if char == "#" else 0 for char in eval(input())]).cumsum(), 0, 0
    )
    for i in range(a, max(c, d)):
        if nv[i + 2] - nv[i] == 2:
            print("No")
            sys.exit()
    if c < d:
        print("Yes")
        sys.exit()
    for i in range(b, d + 1):
        if nv[i + 2] - nv[i - 1] == 0:
            print("Yes")
            sys.exit()
    print("No")


main()

import sys
import numpy as np


def main():
    n, a, b, c, d = [int(x) for x in input().split()]
    nv = np.insert(np.array([1 if char == "#" else 0 for char in eval(input())]), 0, 0)
    nv1 = nv[1:] + nv[:-1]
    nv2 = nv[2:] + nv[1:-1] + nv[:-2]
    if np.any(nv1[a : max(c, d)] == 2):
        print("No")
    elif c < d:
        print("Yes")
    elif np.any(nv2[b - 1 : d] == 0):
        print("Yes")
    else:
        print("No")


main()

-    a -= 1 -    b -= 1 -    c -= 1 -    d -= 1 -    nv = np.insert( -        np.array([1 if char == "#" else 0 for char in eval(input())]).cumsum(), 0, 0 -    ) -    for i in range(a, max(c, d)): -        if nv[i + 2] - nv[i] == 2: -            print("No") -            sys.exit() -    if c < d: +    nv = np.insert(np.array([1 if char == "#" else 0 for char in eval(input())]), 0, 0) +    nv1 = nv[1:] + nv[:-1] +    nv2 = nv[2:] + nv[1:-1] + nv[:-2] +    if np.any(nv1[a : max(c, d)] == 2): +        print("No") +    elif c < d: -        sys.exit() -    for i in range(b, d + 1): -        if nv[i + 2] - nv[i - 1] == 0: -            print("Yes") -            sys.exit() -    print("No") +    elif np.any(nv2[b - 1 : d] == 0): +        print("Yes") +    else: +        print("No")