#!/usr/bin/env python
"""<https://github.com/cheran-senthil/PyRival>"""
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
else:
    _str = str
    str = lambda x=b"": x if type(x) is bytes else _str(x).encode()


def main():
    n, a, b, c, d = read_int_array()
    a -= 1
    b -= 1
    c -= 1
    d -= 1
    s = read() + b'###'
    if s[d] == '#' or s[c] == '#':
        print('No')
    else:
        if c < d:
            while b < d:
                if b + 1 == d:
                    b += 1
                elif s[b + 2] == '.':
                    b += 2
                elif s[b + 1] == '.':
                    b += 1
                else:
                    print('No')
                    return
            while a < c:
                if a + 1 == c:
                    a += 1
                elif s[a + 2] == '.':
                    a += 2
                elif s[a + 1] == '.':
                    a += 1
                else:
                    print('No')
                    return
            print("Yes")
        else:
            while a < c:
                if a + 1 == c:
                    if a + 1 == b:
                        if b + 1 == d:
                            b += 1
                        elif s[b + 2] == '.':
                            b += 2
                        elif s[b + 1] == '.':
                            b += 1
                        else:
                            print('No')
                            return
                    a += 1
                elif s[a + 1] == '.' and b != a + 1:
                    a += 1
                elif s[a + 2] == '.' and b != a + 2:
                    a += 2
                elif a + 1 == b:
                    if s[a + 2] == '.':
                        a += 2
                    elif s[a + 3] == '.':
                        b += 2
                    else:
                        print("No")
                        return
                elif a + 2 == b:
                    if s[a + 3] == '.':
                        b += 1
                        a += 2
                    elif s[a + 4] == '.':
                        b += 2
                        a += 2
                    else:
                        print("No")
                        return
                else:
                    print('No')
                    return
            if b > d:
                print("No")
                return
            while b < d:
                if b + 1 == d:
                    b += 1
                elif s[b + 2] == '.':
                    b += 2
                elif s[b + 1] == '.':
                    b += 1
                else:
                    print('No')
                    return
            print("Yes")


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        if self.buffer.tell():
            return self.buffer.read()
        return os.read(self._fd, os.fstat(self._fd).st_size)

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", b" "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", b"\n"))
    if kwargs.pop("flush", False):
        file.flush()


sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip(b"\r\n")


def read():
    return input()


def read_array(sep=None, maxsplit=-1):
    return read().split(sep, maxsplit)


def read_int():
    return int(read())


def read_int_array(sep=None, maxsplit=-1):
    return [int(a) for a in read_array(sep, maxsplit)]


# endregion

if __name__ == "__main__":
    main()

Measured memory_bytes: 34028