n,A,B,c,d=map(int,input().split())
s=input()
b=B-1
a=A-1
t=0
while t<2*n:
  if a!=c-1:
    if a+1<n and s[a+1]=='.' and a+1!=b:
      a+=1
    elif a+2<n and s[a+2]=='.' and a+2!=b and a+2<=c-1:
      a+=2
    else:
      if b+1<n and s[b+1]=='.' and b+1!=a:
        b+=1
      elif b+2<n and s[b+2]=='.' and b+2!=a and b+2<=d-1:
        b+=2
  else:
    if b!=d-1:
      if b+1<n and s[b+1]=='.' and b+1!=a:
        b+=1
      elif b+2<n and s[b+2]=='.' and b+2!=a and b+2<=d-1:
        b+=2
  t+=1
if a==c-1 and b==d-1:
  print('Yes')
else:
  print('No') 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 b=B-1 b B-1 B 1 a=A-1 a A-1 A 1 t=0 t 0 while t<2*n:
  if a!=c-1:
    if a+1<n and s[a+1]=='.' and a+1!=b:
      a+=1
    elif a+2<n and s[a+2]=='.' and a+2!=b and a+2<=c-1:
      a+=2
    else:
      if b+1<n and s[b+1]=='.' and b+1!=a:
        b+=1
      elif b+2<n and s[b+2]=='.' and b+2!=a and b+2<=d-1:
        b+=2
  else:
    if b!=d-1:
      if b+1<n and s[b+1]=='.' and b+1!=a:
        b+=1
      elif b+2<n and s[b+2]=='.' and b+2!=a and b+2<=d-1:
        b+=2
  t+=1 t<2*n t 2*n 2 n if a!=c-1:
    if a+1<n and s[a+1]=='.' and a+1!=b:
      a+=1
    elif a+2<n and s[a+2]=='.' and a+2!=b and a+2<=c-1:
      a+=2
    else:
      if b+1<n and s[b+1]=='.' and b+1!=a:
        b+=1
      elif b+2<n and s[b+2]=='.' and b+2!=a and b+2<=d-1:
        b+=2
  else:
    if b!=d-1:
      if b+1<n and s[b+1]=='.' and b+1!=a:
        b+=1
      elif b+2<n and s[b+2]=='.' and b+2!=a and b+2<=d-1:
        b+=2
   a!=c-1 a c-1 c 1 if a+1<n and s[a+1]=='.' and a+1!=b:
      a+=1
    elif a+2<n and s[a+2]=='.' and a+2!=b and a+2<=c-1:
      a+=2
    else:
      if b+1<n and s[b+1]=='.' and b+1!=a:
        b+=1
      elif b+2<n and s[b+2]=='.' and b+2!=a and b+2<=d-1:
        b+=2
   a+1<n and s[a+1]=='.' and a+1!=b a+1<n and s[a+1]=='.' a+1<n a+1 a 1 n s[a+1]=='.' s[a+1] s a+1 a 1 '.' a+1!=b a+1 a 1 b a+=1 a 1 elif a+2<n and s[a+2]=='.' and a+2!=b and a+2<=c-1:
      a+=2
     a+2<n and s[a+2]=='.' and a+2!=b and a+2<=c-1 a+2<n and s[a+2]=='.' and a+2!=b a+2<n and s[a+2]=='.' a+2<n a+2 a 2 n s[a+2]=='.' s[a+2] s a+2 a 2 '.' a+2!=b a+2 a 2 b a+2<=c-1 a+2 a 2 c-1 c 1 a+=2 a 2 if b+1<n and s[b+1]=='.' and b+1!=a:
        b+=1
      elif b+2<n and s[b+2]=='.' and b+2!=a and b+2<=d-1:
        b+=2
   b+1<n and s[b+1]=='.' and b+1!=a b+1<n and s[b+1]=='.' b+1<n b+1 b 1 n s[b+1]=='.' s[b+1] s b+1 b 1 '.' b+1!=a b+1 b 1 a b+=1 b 1 elif b+2<n and s[b+2]=='.' and b+2!=a and b+2<=d-1:
        b+=2
   b+2<n and s[b+2]=='.' and b+2!=a and b+2<=d-1 b+2<n and s[b+2]=='.' and b+2!=a b+2<n and s[b+2]=='.' b+2<n b+2 b 2 n s[b+2]=='.' s[b+2] s b+2 b 2 '.' b+2!=a b+2 b 2 a b+2<=d-1 b+2 b 2 d-1 d 1 b+=2 b 2 if b!=d-1:
      if b+1<n and s[b+1]=='.' and b+1!=a:
        b+=1
      elif b+2<n and s[b+2]=='.' and b+2!=a and b+2<=d-1:
        b+=2
   b!=d-1 b d-1 d 1 if b+1<n and s[b+1]=='.' and b+1!=a:
        b+=1
      elif b+2<n and s[b+2]=='.' and b+2!=a and b+2<=d-1:
        b+=2
   b+1<n and s[b+1]=='.' and b+1!=a b+1<n and s[b+1]=='.' b+1<n b+1 b 1 n s[b+1]=='.' s[b+1] s b+1 b 1 '.' b+1!=a b+1 b 1 a b+=1 b 1 elif b+2<n and s[b+2]=='.' and b+2!=a and b+2<=d-1:
        b+=2
   b+2<n and s[b+2]=='.' and b+2!=a and b+2<=d-1 b+2<n and s[b+2]=='.' and b+2!=a b+2<n and s[b+2]=='.' b+2<n b+2 b 2 n s[b+2]=='.' s[b+2] s b+2 b 2 '.' b+2!=a b+2 b 2 a b+2<=d-1 b+2 b 2 d-1 d 1 b+=2 b 2 t+=1 t 1 if a==c-1 and b==d-1:
  print('Yes')
else:
  print('No') a==c-1 and b==d-1 a==c-1 a c-1 c 1 b==d-1 b d-1 d 1 print('Yes') print 'Yes' print('No') print 'No' d=map(int,input().split()) map(int,input().split()) d a=A-1 A-1 a B,c,d=map(int,input().split()) map(int,input().split()) B a+=1 1 a b+=1 1 b b+=2 2 b t+=1 1 t c,d=map(int,input().split()) map(int,input().split()) c s=input() input() s b=B-1 B-1 b b+=2 2 b t=0 0 t n,A,B,c,d=map(int,input().split()) map(int,input().split()) n b+=1 1 b a+=2 2 a A,B,c,d=map(int,input().split()) map(int,input().split()) A
n,A,B,c,d=map(int,input().split())
s=input()
b=B-1
a=A-1
t=0
while t<2*n:
  if a!=c-1:
    if a+1<n and s[a+1]=='.' and a+1!=b:
      a+=1
    elif a+2<n and s[a+2]=='.' and a+2!=b and a+2<=c-1:
      a+=2
    else:
      if b+1<n and s[b+1]=='.' and b+1!=a:
        b+=1
      elif b+2<n and s[b+2]=='.' and b+2!=a and b+2<=d-1:
        b+=2
  else:
    if b!=d-1:
      if b+1<n and s[b+1]=='.' and b+1!=a:
        b+=1
      elif b+2<n and s[b+2]=='.' and b+2!=a and b+2<=d-1:
        b+=2
  t+=1
if a==c-1 and b==d-1:
  print('Yes')
else:
  print('No')