import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void scan(T...)(ref T a) {
    string[] ss = readln.split;
    foreach (i, t; T) a[i] = ss[i].to!t;
}
T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

bool ok1(int src, int a, int b, string s) {
    if (src + 1 >= s.length) return false;
    if (src + 1 == a || src + 1 == b) return false;
    if (s[src + 1] == '#') return false;
    return true;
}

bool ok2(int src, int a, int b, string s) {
    if (src + 2 >= s.length) return false;
    if (src + 2 == a || src + 2 == b) return false;
    if (s[src + 2] == '#') return false;
    return true;
}

bool calc_ba(string s, int n, int a, int b, int c, int d) {
    assert(c > d);
    // a を先に進ませる

    while (a != c || b != d) {
        if (a > c || b > d) break;

        // a を先に進ませて、b を超えさせる
        if (a < b) {
            if (ok1(a, a, b, s)) {
                a++;
                continue;
            }
            else if (ok2(a, a, b, s)) {
                a += 2;
                continue;
            }
            else if (ok1(b, a, b, s)) {
                b++;
                continue;
            }
            else if (ok2(b, a, b, s)) {
                b += 2;
                continue;
            }
            else break; // a, b いずれも移動できない
        }

        assert(a > b);
        if (a != c) {
            if (ok1(a, a, b, s)) {
                a++;
                continue;
            }
            else if (ok2(a, a, b, s)) {
                a += 2;
                continue;
            }
            else break;
        }

        if (b != d) {
            if (ok1(b, a, b, s)) {
                b++;
                continue;
            }
            else if (ok2(b, a, b, s)) {
                b += 2;
                continue;
            }
            else break;
        }
    }

    return a == c && b == d;
}

bool calc(string s, int n, int a, int b, int c, int d) {
    if (c > d) return calc_ba(s, n, a, b, c, d);

    assert(c < d);
    while (a != c || b != d) {
        if (b != d) {
            if (ok1(b, a, b, s)) {
                b++;
                continue;
            }
            else if (ok2(b, a, b, s)) {
                b += 2;
                continue;
            }
            else break;
        }

        if (a != c) {
            if (ok1(a, a, b, s)) {
                a++;
                continue;
            }
            else if (ok2(a, a, b, s)) {
                a += 2;
                continue;
            }
            else break;
        }
    }

    return a == c && b == d;
}

void main() {
    int n, a, b, c, d; scan(n, a, b, c, d);
    string s = read!string;
    writeln(calc(s, n, a-1, b-1, c-1, d-1) ? "Yes" : "No");
}
