import sys
input = sys.stdin.readline
N, A, B, C, D = map(int, input().split())
S = list(input())[: -1]
tri = 0
for i in range(min(A, B) - 1, max(C, D) - 1):
  if S[i] == "#" and (S[i + 1] == "#"):
    print("No")
    exit(0)
for i in range(max(A, B) - 1, min(C, D)):
  if S[i] == "." and (S[i - 1] == ".") and (S[i + 1] == "."): tri = 1
if C <= D:
  print("Yes")
else:
  if tri: print("Yes")
  else: print("No") import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline N, A, B, C, D = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split A B C D S = list(input())[: -1] S list(input())[: -1] (input()) list input() input : -1 -1 tri = 0 tri 0 for i in range(min(A, B) - 1, max(C, D) - 1):
  if S[i] == "#" and (S[i + 1] == "#"):
    print("No")
    exit(0) i range(min(A, B) - 1, max(C, D) - 1) range min(A, B) - 1 min(A, B) min A B 1 max(C, D) - 1 max(C, D) max C D 1 if S[i] == "#" and (S[i + 1] == "#"):
    print("No")
    exit(0) S[i] == "#" and (S[i + 1] == "#") S[i] == "#" S[i] S i "#" S[i + 1] == "#" S[i + 1] S i + 1 i 1 "#" print("No") print "No" exit(0) exit 0 for i in range(max(A, B) - 1, min(C, D)):
  if S[i] == "." and (S[i - 1] == ".") and (S[i + 1] == "."): tri = 1 i range(max(A, B) - 1, min(C, D)) range max(A, B) - 1 max(A, B) max A B 1 min(C, D) min C D if S[i] == "." and (S[i - 1] == ".") and (S[i + 1] == "."): tri = S[i] == "." and (S[i - 1] == ".") and (S[i + 1] == ".") S[i] == "." and (S[i - 1] == ".") S[i] == "." S[i] S i "." S[i - 1] == "." S[i - 1] S i - 1 i 1 "." S[i + 1] == "." S[i + 1] S i + 1 i 1 "." if C <= D:
  print("Yes")
else:
  if tri: print("Yes")
  else: print("No") C <= D C D print("Yes") print "Yes" if tri: print("Yes")
  else: print("No") tri input = sys.stdin.readline sys.stdin.readline input A, B, C, D = map(int, input().split()) map(int, input().split()) A S = list(input())[: -1] list(input())[: -1] S C, D = map(int, input().split()) map(int, input().split()) C B, C, D = map(int, input().split()) map(int, input().split()) B tri = 0 0 tri D = map(int, input().split()) map(int, input().split()) D N, A, B, C, D = map(int, input().split()) map(int, input().split()) N
import sys
input = sys.stdin.readline
N, A, B, C, D = map(int, input().split())
S = list(input())[: -1]
tri = 0
for i in range(min(A, B) - 1, max(C, D) - 1):
  if S[i] == "#" and (S[i + 1] == "#"):
    print("No")
    exit(0)
for i in range(max(A, B) - 1, min(C, D)):
  if S[i] == "." and (S[i - 1] == ".") and (S[i + 1] == "."): tri = 1
if C <= D:
  print("Yes")
else:
  if tri: print("Yes")
  else: print("No")
