Scanf.scanf " %d %d %d %d %d" @@ fun n a b c d ->
  let a, b, c, d = a - 1, b - 1, c - 1, d - 1 in
  let s = Scanf.scanf " %s" @@ fun s -> s in
  let l, l_end, r, r_end = if a < b then a, c, b, d else b, d, a, c in
  let dp = Array.make n false in
  dp.(r) <- true;
  dp.(r + 1) <- s.[r + 1] <> '#';
  for i = r + 2 to n - 1 do
    dp.(i) <- s.[i] <> '#' && (dp.(i - 1) || dp.(i - 2))
  done;
  if not dp.(r_end) then (print_endline "No"; exit 0);
  let dp = Array.make n false in
  dp.(l) <- true;
  dp.(l + 1) <- s.[l + 1] <> '#';
  for i = l + 2 to n - 1 do
    dp.(i) <- s.[i] <> '#' && (dp.(i - 1) || dp.(i - 2))
  done;
  if not dp.(l_end) then (print_endline "No"; exit 0);
  for i = r to r_end do
    if i >= 1 && dp.(i - 1) && s.[i - 1] = '.' && (i + 1 <= n - 1 && dp.(i + 1) && s.[i + 1] = '.') then
      (print_endline "Yes"; exit 0)
  done;
  print_endline @@
    if s.[r_end - 1] = '#' || (r_end + 1 < n && s.[r_end + 1] = '#') then
      try
        let i = Str.search_forward (Str.regexp "___") s r in
        if i < r_end then "Yes" else "No" with
      | _ -> "No"
    else "Yes"