import sys
N,A,B,C,D=map(int,input().split())
S=input()
if C<D:
  for i in range(A-1,D-1):
    if S[i]=="#" and S[i+1]=="#":
      print("No")
      sys.exit()
  print("Yes")
  sys.exit()
else:
  for i in range(A-1,C-1):
    if S[i]=="#" and S[i+1]=="#":
      print("No")
      sys.exit()  
  for i in range(B-2,D-1):
    if S[i]=="." and S[i+1]=="." and S[i+2]==".":
      print("Yes")
      sys.exit()
    if i==D-2:
      print("No")
      sys.exit()
  print("Yes")
  sys.exit() import sys sys 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 C<D:
  for i in range(A-1,D-1):
    if S[i]=="#" and S[i+1]=="#":
      print("No")
      sys.exit()
  print("Yes")
  sys.exit()
else:
  for i in range(A-1,C-1):
    if S[i]=="#" and S[i+1]=="#":
      print("No")
      sys.exit()  
  for i in range(B-2,D-1):
    if S[i]=="." and S[i+1]=="." and S[i+2]==".":
      print("Yes")
      sys.exit()
    if i==D-2:
      print("No")
      sys.exit()
  print("Yes")
  sys.exit() C<D C D for i in range(A-1,D-1):
    if S[i]=="#" and S[i+1]=="#":
      print("No")
      sys.exit()
   i range(A-1,D-1) range A-1 A 1 D-1 D 1 if S[i]=="#" and S[i+1]=="#":
      print("No")
      sys.exit()
   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" sys.exit() sys.exit sys exit print("Yes") print "Yes" sys.exit() sys.exit sys exit for i in range(A-1,C-1):
    if S[i]=="#" and S[i+1]=="#":
      print("No")
      sys.exit()  
   i range(A-1,C-1) range A-1 A 1 C-1 C 1 if S[i]=="#" and S[i+1]=="#":
      print("No")
      sys.exit()  
   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" sys.exit() sys.exit sys exit for i in range(B-2,D-1):
    if S[i]=="." and S[i+1]=="." and S[i+2]==".":
      print("Yes")
      sys.exit()
    if i==D-2:
      print("No")
      sys.exit()
   i range(B-2,D-1) range B-2 B 2 D-1 D 1 if S[i]=="." and S[i+1]=="." and S[i+2]==".":
      print("Yes")
      sys.exit()
     S[i]=="." and S[i+1]=="." and S[i+2]=="." 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+2]=="." S[i+2] S i+2 i 2 "." print("Yes") print "Yes" sys.exit() sys.exit sys exit if i==D-2:
      print("No")
      sys.exit()
   i==D-2 i D-2 D 2 print("No") print "No" sys.exit() sys.exit sys exit print("Yes") print "Yes" sys.exit() sys.exit sys exit B,C,D=map(int,input().split()) map(int,input().split()) B C,D=map(int,input().split()) map(int,input().split()) C N,A,B,C,D=map(int,input().split()) map(int,input().split()) N A,B,C,D=map(int,input().split()) map(int,input().split()) A D=map(int,input().split()) map(int,input().split()) D S=input() input() S
import sys
N,A,B,C,D=map(int,input().split())
S=input()
if C<D:
  for i in range(A-1,D-1):
    if S[i]=="#" and S[i+1]=="#":
      print("No")
      sys.exit()
  print("Yes")
  sys.exit()
else:
  for i in range(A-1,C-1):
    if S[i]=="#" and S[i+1]=="#":
      print("No")
      sys.exit()  
  for i in range(B-2,D-1):
    if S[i]=="." and S[i+1]=="." and S[i+2]==".":
      print("Yes")
      sys.exit()
    if i==D-2:
      print("No")
      sys.exit()
  print("Yes")
  sys.exit()