import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,A,B,C,D =MI()
    S=input()
    A-=1
    B-=1
    C-=1
    D-=1
    
    flag=1
    if "##" in S[A:C+1]:
        flag=0
    if "##" in S[B:D+1]:
        flag=0
        
    if C>D:
        if "..." in S[B-1:D+2]:
            pass
        else:
            flag=0
            
    if flag:
        print("Yes")
    else:
        print("No")
        

main() import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def I(): return int(input()) I def MI(): return map(int, input().split()) MI def LI(): return list(map(int, input().split())) LI def main():
    mod=10**9+7
    N,A,B,C,D =MI()
    S=input()
    A-=1
    B-=1
    C-=1
    D-=1
    
    flag=1
    if "##" in S[A:C+1]:
        flag=0
    if "##" in S[B:D+1]:
        flag=0
        
    if C>D:
        if "..." in S[B-1:D+2]:
            pass
        else:
            flag=0
            
    if flag:
        print("Yes")
    else:
        print("No")
         main mod=10**9+7 mod 10**9+7 10**9 10 9 7 N,A,B,C,D =MI() N MI() MI A B C D S=input() S input() input A-=1 A 1 B-=1 B 1 C-=1 C 1 D-=1 D 1 flag=1 flag 1 if "##" in S[A:C+1]:
        flag=0
     "##" in S[A:C+1] "##" S[A:C+1] S A:C+1 A C+1 C 1 flag=0 flag 0 if "##" in S[B:D+1]:
        flag=0
        
     "##" in S[B:D+1] "##" S[B:D+1] S B:D+1 B D+1 D 1 flag=0 flag 0 if C>D:
        if "..." in S[B-1:D+2]:
            pass
        else:
            flag=0
            
     C>D C D if "..." in S[B-1:D+2]:
            pass
        else:
            flag=0
            
     "..." in S[B-1:D+2] "..." S[B-1:D+2] S B-1:D+2 B-1 B 1 D+2 D 2 flag=0 flag 0 if flag:
        print("Yes")
    else:
        print("No")
         flag print("Yes") print "Yes" print("No") print "No" main() main def I(): return int(input()) def I(): return int(input()) I def LI(): return list(map(int, input().split())) def LI(): return list(map(int, input().split())) LI def main():
    mod=10**9+7
    N,A,B,C,D =MI()
    S=input()
    A-=1
    B-=1
    C-=1
    D-=1
    
    flag=1
    if "##" in S[A:C+1]:
        flag=0
    if "##" in S[B:D+1]:
        flag=0
        
    if C>D:
        if "..." in S[B-1:D+2]:
            pass
        else:
            flag=0
            
    if flag:
        print("Yes")
    else:
        print("No")
         def main():
    mod=10**9+7
    N,A,B,C,D =MI()
    S=input()
    A-=1
    B-=1
    C-=1
    D-=1
    
    flag=1
    if "##" in S[A:C+1]:
        flag=0
    if "##" in S[B:D+1]:
        flag=0
        
    if C>D:
        if "..." in S[B-1:D+2]:
            pass
        else:
            flag=0
            
    if flag:
        print("Yes")
    else:
        print("No")
         main def MI(): return map(int, input().split()) def MI(): return map(int, input().split()) MI input = sys.stdin.readline sys.stdin.readline input
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,A,B,C,D =MI()
    S=input()
    A-=1
    B-=1
    C-=1
    D-=1
    
    flag=1
    if "##" in S[A:C+1]:
        flag=0
    if "##" in S[B:D+1]:
        flag=0
        
    if C>D:
        if "..." in S[B-1:D+2]:
            pass
        else:
            flag=0
            
    if flag:
        print("Yes")
    else:
        print("No")
        

main()
