import std.conv, std.functional, std.range, std.stdio, std.string;
import std.algorithm, std.array, std.bigint, std.complex, std.container, std.math, std.numeric, std.regex, std.typecons;
import core.bitop;

class EOFException : Throwable { this() { super("EOF"); } }
string[] tokens;
string readToken() { for (; tokens.empty; ) { if (stdin.eof) { throw new EOFException; } tokens = readln.split; } auto token = tokens.front; tokens.popFront; return token; }
int readInt() { return readToken.to!int; }
long readLong() { return readToken.to!long; }
real readReal() { return readToken.to!real; }

bool chmin(T)(ref T t, in T f) { if (t > f) { t = f; return true; } else { return false; } }
bool chmax(T)(ref T t, in T f) { if (t < f) { t = f; return true; } else { return false; } }

int binarySearch(alias pred, T)(in T[] as) { int lo = -1, hi = cast(int)(as.length); for (; lo + 1 < hi; ) { const mid = (lo + hi) >> 1; (unaryFun!pred(as[mid]) ? hi : lo) = mid; } return hi; }
int lowerBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a >= val)); }
int upperBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a > val)); }


int N, A, B, C, D;
string S;

void main() {
  try {
    for (; ; ) {
      N = readInt();
      A = readInt() - 1;
      B = readInt() - 1;
      C = readInt() - 1;
      D = readInt() - 1;
      S = readToken();
      
      auto a = new bool[N];
      auto b = new bool[N];
      auto c = new bool[N];
      auto d = new bool[N];
      a[A] = b[B] = c[C] = d[D] = true;
      foreach (x; 0 .. N) if (a[x]) foreach (xx; [x + 1, x + 2]) if (xx < N) if (S[xx] != '#') a[xx] = true;
      foreach (x; 0 .. N) if (b[x]) foreach (xx; [x + 1, x + 2]) if (xx < N) if (S[xx] != '#') b[xx] = true;
      foreach_reverse (x; 0 .. N) if (c[x]) foreach (xx; [x - 1, x - 2]) if (xx >= 0) if (S[xx] != '#') c[xx] = true;
      foreach_reverse (x; 0 .. N) if (d[x]) foreach (xx; [x - 1, x - 2]) if (xx >= 0) if (S[xx] != '#') d[xx] = true;
      debug {
        writeln("a = ", a.map!(f => f ? 'o' : 'x'));
        writeln("b = ", b.map!(f => f ? 'o' : 'x'));
        writeln("c = ", c.map!(f => f ? 'o' : 'x'));
        writeln("d = ", d.map!(f => f ? 'o' : 'x'));
      }
      
      bool ans;
      if (C < D) {
        ans = a[C] && b[D];
      } else {
        foreach (x; B .. D + 1) {
          ans = ans || (a[x - 1] && c[x + 1] && b[x] && d[x]);
        }
      }
      writeln(ans ? "Yes" : "No");
    }
  } catch (EOFException e) {
  }
}
