N, A, B, C, D = map(int, input().split())
S = input()

if "##" in S[A:C] or "##" in S[B:D]:
  print("No")
  exit()

if D - C < 0:
  if "..." not in S[B-2:D+1]:
    print("No")
    exit()
    
print("Yes") 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 = input() S input() input if "##" in S[A:C] or "##" in S[B:D]:
  print("No")
  exit() "##" in S[A:C] or "##" in S[B:D] "##" in S[A:C] "##" S[A:C] S A:C A C "##" in S[B:D] "##" S[B:D] S B:D B D print("No") print "No" exit() exit if D - C < 0:
  if "..." not in S[B-2:D+1]:
    print("No")
    exit()
     D - C < 0 D - C D C 0 if "..." not in S[B-2:D+1]:
    print("No")
    exit()
     "..." not in S[B-2:D+1] "..." S[B-2:D+1] S B-2:D+1 B-2 B 2 D+1 D 1 print("No") print "No" exit() exit print("Yes") print "Yes" C, D = map(int, input().split()) map(int, input().split()) C D = map(int, input().split()) map(int, input().split()) D A, B, C, D = map(int, input().split()) map(int, input().split()) A B, C, D = map(int, input().split()) map(int, input().split()) B N, A, B, C, D = map(int, input().split()) map(int, input().split()) N S = input() input() S
N, A, B, C, D = map(int, input().split())
S = input()

if "##" in S[A:C] or "##" in S[B:D]:
  print("No")
  exit()

if D - C < 0:
  if "..." not in S[B-2:D+1]:
    print("No")
    exit()
    
print("Yes")