n,a,b,c,d=map(int,input().split())
s=input()

s="#"+s+"#"

def solve():
    can_reach=True

    for i in range(a,c+1):
        if s[i]=="#" and s[i+1]=="#":
            can_reach=False
            break
    
    for i in range(b,d+1):
        if s[i]=="#" and s[i+1]=="#":
            can_reach=False
            break

    if not can_reach:
        print("No")
        return

    if c>d:
        snuke_can_over=False
        for i in range(b,d+1):
            if s[i-1]=="." and s[i]=="." and s[i+1]==".":
                snuke_can_over=True
                break
        
        if not snuke_can_over:
            print("No")
            return
    
    print("Yes")


if __name__ == "__main__":
    solve() 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+"#" s "#"+s+"#" "#"+s "#" s "#" def solve():
    can_reach=True

    for i in range(a,c+1):
        if s[i]=="#" and s[i+1]=="#":
            can_reach=False
            break
    
    for i in range(b,d+1):
        if s[i]=="#" and s[i+1]=="#":
            can_reach=False
            break

    if not can_reach:
        print("No")
        return

    if c>d:
        snuke_can_over=False
        for i in range(b,d+1):
            if s[i-1]=="." and s[i]=="." and s[i+1]==".":
                snuke_can_over=True
                break
        
        if not snuke_can_over:
            print("No")
            return
    
    print("Yes") solve can_reach=True can_reach True for i in range(a,c+1):
        if s[i]=="#" and s[i+1]=="#":
            can_reach=False
            break
    
     i range(a,c+1) range a c+1 c 1 if s[i]=="#" and s[i+1]=="#":
            can_reach=False
            break
    
     s[i]=="#" and s[i+1]=="#" s[i]=="#" s[i] s i "#" s[i+1]=="#" s[i+1] s i+1 i 1 "#" can_reach=False can_reach False break for i in range(b,d+1):
        if s[i]=="#" and s[i+1]=="#":
            can_reach=False
            break

     i range(b,d+1) range b d+1 d 1 if s[i]=="#" and s[i+1]=="#":
            can_reach=False
            break

     s[i]=="#" and s[i+1]=="#" s[i]=="#" s[i] s i "#" s[i+1]=="#" s[i+1] s i+1 i 1 "#" can_reach=False can_reach False break if not can_reach:
        print("No")
        return

     not can_reach can_reach print("No") print "No" return if c>d:
        snuke_can_over=False
        for i in range(b,d+1):
            if s[i-1]=="." and s[i]=="." and s[i+1]==".":
                snuke_can_over=True
                break
        
        if not snuke_can_over:
            print("No")
            return
    
     c>d c d snuke_can_over=False snuke_can_over False for i in range(b,d+1):
            if s[i-1]=="." and s[i]=="." and s[i+1]==".":
                snuke_can_over=True
                break
        
         i range(b,d+1) range b d+1 d 1 if s[i-1]=="." and s[i]=="." and s[i+1]==".":
                snuke_can_over=True
                break
        
         s[i-1]=="." and s[i]=="." and s[i+1]=="." s[i-1]=="." and s[i]=="." s[i-1]=="." s[i-1] s i-1 i 1 "." s[i]=="." s[i] s i "." s[i+1]=="." s[i+1] s i+1 i 1 "." snuke_can_over=True snuke_can_over True break if not snuke_can_over:
            print("No")
            return
    
     not snuke_can_over snuke_can_over print("No") print "No" return print("Yes") print "Yes" if __name__ == "__main__":
    solve() __name__ == "__main__" __name__ "__main__" solve() solve 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 s="#"+s+"#" "#"+s+"#" s 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 def solve():
    can_reach=True

    for i in range(a,c+1):
        if s[i]=="#" and s[i+1]=="#":
            can_reach=False
            break
    
    for i in range(b,d+1):
        if s[i]=="#" and s[i+1]=="#":
            can_reach=False
            break

    if not can_reach:
        print("No")
        return

    if c>d:
        snuke_can_over=False
        for i in range(b,d+1):
            if s[i-1]=="." and s[i]=="." and s[i+1]==".":
                snuke_can_over=True
                break
        
        if not snuke_can_over:
            print("No")
            return
    
    print("Yes") def solve():
    can_reach=True

    for i in range(a,c+1):
        if s[i]=="#" and s[i+1]=="#":
            can_reach=False
            break
    
    for i in range(b,d+1):
        if s[i]=="#" and s[i+1]=="#":
            can_reach=False
            break

    if not can_reach:
        print("No")
        return

    if c>d:
        snuke_can_over=False
        for i in range(b,d+1):
            if s[i-1]=="." and s[i]=="." and s[i+1]==".":
                snuke_can_over=True
                break
        
        if not snuke_can_over:
            print("No")
            return
    
    print("Yes") solve d=map(int,input().split()) map(int,input().split()) d
n,a,b,c,d=map(int,input().split())
s=input()

s="#"+s+"#"

def solve():
    can_reach=True

    for i in range(a,c+1):
        if s[i]=="#" and s[i+1]=="#":
            can_reach=False
            break
    
    for i in range(b,d+1):
        if s[i]=="#" and s[i+1]=="#":
            can_reach=False
            break

    if not can_reach:
        print("No")
        return

    if c>d:
        snuke_can_over=False
        for i in range(b,d+1):
            if s[i-1]=="." and s[i]=="." and s[i+1]==".":
                snuke_can_over=True
                break
        
        if not snuke_can_over:
            print("No")
            return
    
    print("Yes")


if __name__ == "__main__":
    solve()