from collections import deque

def dfs(snuke,fnuke):
    global n,a,b,c,d,s
    que = deque()
    que.append([snuke,fnuke])
    lq = 1
    while(lq > 0):
        tmp = que.pop()
        tmps = tmp[0]
        tmpf = tmp[1]
        lq-=1
        if tmps == c and tmpf == d:
            return True
        if tmps+1 != tmpf and s[tmps] =="." and tmps != c:
            que.append([tmps+1,tmpf])
            lq+=1
        elif tmps+2 != tmpf and s[tmps+1] =="." and tmps != c:
            que.append([tmps+2,tmpf])
            lq+=1
        elif tmpf+1 != tmps and s[tmpf] =="." and tmpf != d:
            que.append([tmps,tmpf+1])
            lq+=1
        elif tmpf+2 != tmps and s[tmpf+1] =="." and tmpf != d:
            que.append([tmps,tmpf+2])
            lq+=1
    return False

n,a,b,c,d = map(int,input().split())
s = input()
s += "###"
snuke = a
fnuke = b
if dfs(snuke,fnuke):
    print("Yes")
else:
    print("No") from collections import deque def dfs(snuke,fnuke):
    global n,a,b,c,d,s
    que = deque()
    que.append([snuke,fnuke])
    lq = 1
    while(lq > 0):
        tmp = que.pop()
        tmps = tmp[0]
        tmpf = tmp[1]
        lq-=1
        if tmps == c and tmpf == d:
            return True
        if tmps+1 != tmpf and s[tmps] =="." and tmps != c:
            que.append([tmps+1,tmpf])
            lq+=1
        elif tmps+2 != tmpf and s[tmps+1] =="." and tmps != c:
            que.append([tmps+2,tmpf])
            lq+=1
        elif tmpf+1 != tmps and s[tmpf] =="." and tmpf != d:
            que.append([tmps,tmpf+1])
            lq+=1
        elif tmpf+2 != tmps and s[tmpf+1] =="." and tmpf != d:
            que.append([tmps,tmpf+2])
            lq+=1
    return False dfs global n,a,b,c,d,s que = deque() que deque() deque que.append([snuke,fnuke]) que.append que append [snuke,fnuke] snuke fnuke lq = 1 lq 1 while(lq > 0):
        tmp = que.pop()
        tmps = tmp[0]
        tmpf = tmp[1]
        lq-=1
        if tmps == c and tmpf == d:
            return True
        if tmps+1 != tmpf and s[tmps] =="." and tmps != c:
            que.append([tmps+1,tmpf])
            lq+=1
        elif tmps+2 != tmpf and s[tmps+1] =="." and tmps != c:
            que.append([tmps+2,tmpf])
            lq+=1
        elif tmpf+1 != tmps and s[tmpf] =="." and tmpf != d:
            que.append([tmps,tmpf+1])
            lq+=1
        elif tmpf+2 != tmps and s[tmpf+1] =="." and tmpf != d:
            que.append([tmps,tmpf+2])
            lq+=1
     lq > 0 lq 0 tmp = que.pop() tmp que.pop() que.pop que pop tmps = tmp[0] tmps tmp[0] tmp 0 tmpf = tmp[1] tmpf tmp[1] tmp 1 lq-=1 lq 1 if tmps == c and tmpf == d:
            return True
         tmps == c and tmpf == d tmps == c tmps c tmpf == d tmpf d return True True if tmps+1 != tmpf and s[tmps] =="." and tmps != c:
            que.append([tmps+1,tmpf])
            lq+=1
        elif tmps+2 != tmpf and s[tmps+1] =="." and tmps != c:
            que.append([tmps+2,tmpf])
            lq+=1
        elif tmpf+1 != tmps and s[tmpf] =="." and tmpf != d:
            que.append([tmps,tmpf+1])
            lq+=1
        elif tmpf+2 != tmps and s[tmpf+1] =="." and tmpf != d:
            que.append([tmps,tmpf+2])
            lq+=1
     tmps+1 != tmpf and s[tmps] =="." and tmps != c tmps+1 != tmpf and s[tmps] =="." tmps+1 != tmpf tmps+1 tmps 1 tmpf s[tmps] =="." s[tmps] s tmps "." tmps != c tmps c que.append([tmps+1,tmpf]) que.append que append [tmps+1,tmpf] tmps+1 tmps 1 tmpf lq+=1 lq 1 elif tmps+2 != tmpf and s[tmps+1] =="." and tmps != c:
            que.append([tmps+2,tmpf])
            lq+=1
         tmps+2 != tmpf and s[tmps+1] =="." and tmps != c tmps+2 != tmpf and s[tmps+1] =="." tmps+2 != tmpf tmps+2 tmps 2 tmpf s[tmps+1] =="." s[tmps+1] s tmps+1 tmps 1 "." tmps != c tmps c que.append([tmps+2,tmpf]) que.append que append [tmps+2,tmpf] tmps+2 tmps 2 tmpf lq+=1 lq 1 elif tmpf+1 != tmps and s[tmpf] =="." and tmpf != d:
            que.append([tmps,tmpf+1])
            lq+=1
         tmpf+1 != tmps and s[tmpf] =="." and tmpf != d tmpf+1 != tmps and s[tmpf] =="." tmpf+1 != tmps tmpf+1 tmpf 1 tmps s[tmpf] =="." s[tmpf] s tmpf "." tmpf != d tmpf d que.append([tmps,tmpf+1]) que.append que append [tmps,tmpf+1] tmps tmpf+1 tmpf 1 lq+=1 lq 1 elif tmpf+2 != tmps and s[tmpf+1] =="." and tmpf != d:
            que.append([tmps,tmpf+2])
            lq+=1
     tmpf+2 != tmps and s[tmpf+1] =="." and tmpf != d tmpf+2 != tmps and s[tmpf+1] =="." tmpf+2 != tmps tmpf+2 tmpf 2 tmps s[tmpf+1] =="." s[tmpf+1] s tmpf+1 tmpf 1 "." tmpf != d tmpf d que.append([tmps,tmpf+2]) que.append que append [tmps,tmpf+2] tmps tmpf+2 tmpf 2 lq+=1 lq 1 return False False snuke snuke fnuke fnuke 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 s += "###" s "###" snuke = a snuke a fnuke = b fnuke b if dfs(snuke,fnuke):
    print("Yes")
else:
    print("No") dfs(snuke,fnuke) dfs snuke fnuke print("Yes") print "Yes" print("No") print "No" snuke = a a snuke d = map(int,input().split()) map(int,input().split()) d b,c,d = map(int,input().split()) map(int,input().split()) b s = input() input() s a,b,c,d = map(int,input().split()) map(int,input().split()) a def dfs(snuke,fnuke):
    global n,a,b,c,d,s
    que = deque()
    que.append([snuke,fnuke])
    lq = 1
    while(lq > 0):
        tmp = que.pop()
        tmps = tmp[0]
        tmpf = tmp[1]
        lq-=1
        if tmps == c and tmpf == d:
            return True
        if tmps+1 != tmpf and s[tmps] =="." and tmps != c:
            que.append([tmps+1,tmpf])
            lq+=1
        elif tmps+2 != tmpf and s[tmps+1] =="." and tmps != c:
            que.append([tmps+2,tmpf])
            lq+=1
        elif tmpf+1 != tmps and s[tmpf] =="." and tmpf != d:
            que.append([tmps,tmpf+1])
            lq+=1
        elif tmpf+2 != tmps and s[tmpf+1] =="." and tmpf != d:
            que.append([tmps,tmpf+2])
            lq+=1
    return False def dfs(snuke,fnuke):
    global n,a,b,c,d,s
    que = deque()
    que.append([snuke,fnuke])
    lq = 1
    while(lq > 0):
        tmp = que.pop()
        tmps = tmp[0]
        tmpf = tmp[1]
        lq-=1
        if tmps == c and tmpf == d:
            return True
        if tmps+1 != tmpf and s[tmps] =="." and tmps != c:
            que.append([tmps+1,tmpf])
            lq+=1
        elif tmps+2 != tmpf and s[tmps+1] =="." and tmps != c:
            que.append([tmps+2,tmpf])
            lq+=1
        elif tmpf+1 != tmps and s[tmpf] =="." and tmpf != d:
            que.append([tmps,tmpf+1])
            lq+=1
        elif tmpf+2 != tmps and s[tmpf+1] =="." and tmpf != d:
            que.append([tmps,tmpf+2])
            lq+=1
    return False dfs n,a,b,c,d = map(int,input().split()) map(int,input().split()) n fnuke = b b fnuke s += "###" "###" s c,d = map(int,input().split()) map(int,input().split()) c
from collections import deque

def dfs(snuke,fnuke):
    global n,a,b,c,d,s
    que = deque()
    que.append([snuke,fnuke])
    lq = 1
    while(lq > 0):
        tmp = que.pop()
        tmps = tmp[0]
        tmpf = tmp[1]
        lq-=1
        if tmps == c and tmpf == d:
            return True
        if tmps+1 != tmpf and s[tmps] =="." and tmps != c:
            que.append([tmps+1,tmpf])
            lq+=1
        elif tmps+2 != tmpf and s[tmps+1] =="." and tmps != c:
            que.append([tmps+2,tmpf])
            lq+=1
        elif tmpf+1 != tmps and s[tmpf] =="." and tmpf != d:
            que.append([tmps,tmpf+1])
            lq+=1
        elif tmpf+2 != tmps and s[tmpf+1] =="." and tmpf != d:
            que.append([tmps,tmpf+2])
            lq+=1
    return False

n,a,b,c,d = map(int,input().split())
s = input()
s += "###"
snuke = a
fnuke = b
if dfs(snuke,fnuke):
    print("Yes")
else:
    print("No")
