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

def rockcheck(l,r):
    rock = 0
    for i in range(l,r+1):
        if s[i] == "#":
            rock += 1
            if rock == 2:
                print("No")
                exit()
        else: rock = 0
rockcheck(a,c)
rockcheck(b,d)

ans = "No"
if c < d: ans = "Yes"
else:
    for i in range(b,d+1):
        if s[i] == "#": continue
        if s[i-1] == "." and s[i+1] == ".":
            ans = "Yes"
            break
print(ans) 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 a -= 1 a 1 b -= 1 b 1 c -= 1 c 1 d -= 1 d 1 def rockcheck(l,r):
    rock = 0
    for i in range(l,r+1):
        if s[i] == "#":
            rock += 1
            if rock == 2:
                print("No")
                exit()
        else: rock = 0 rockcheck rock = 0 rock 0 for i in range(l,r+1):
        if s[i] == "#":
            rock += 1
            if rock == 2:
                print("No")
                exit()
        else: rock = 0 i range(l,r+1) range l r+1 r 1 if s[i] == "#":
            rock += 1
            if rock == 2:
                print("No")
                exit()
        else: rock = 0 s[i] == "#" s[i] s i "#" rock += 1 rock 1 if rock == 2:
                print("No")
                exit()
         rock == 2 rock 2 print("No") print "No" exit() exit l l r r rockcheck(a,c) rockcheck a c rockcheck(b,d) rockcheck b d ans = "No" ans "No" if c < d: ans = "Yes"
else:
    for i in range(b,d+1):
        if s[i] == "#": continue
        if s[i-1] == "." and s[i+1] == ".":
            ans = "Yes"
            break c < d c d for i in range(b,d+1):
        if s[i] == "#": continue
        if s[i-1] == "." and s[i+1] == ".":
            ans = "Yes"
            break i range(b,d+1) range b d+1 d 1 if s[i] == "#": continue
         s[i] == "#" s[i] s i "#" if s[i-1] == "." and s[i+1] == ".":
            ans = "Yes"
            break s[i-1] == "." and s[i+1] == "." s[i-1] == "." s[i-1] s i-1 i 1 "." s[i+1] == "." s[i+1] s i+1 i 1 "." ans = "Yes" ans "Yes" break print(ans) print ans b,c,d = map(int,input().split()) map(int,input().split()) b d -= 1 1 d a,b,c,d = map(int,input().split()) map(int,input().split()) a def rockcheck(l,r):
    rock = 0
    for i in range(l,r+1):
        if s[i] == "#":
            rock += 1
            if rock == 2:
                print("No")
                exit()
        else: rock = 0 def rockcheck(l,r):
    rock = 0
    for i in range(l,r+1):
        if s[i] == "#":
            rock += 1
            if rock == 2:
                print("No")
                exit()
        else: rock = 0 rockcheck ans = "Yes" "Yes" ans c,d = map(int,input().split()) map(int,input().split()) c a -= 1 1 a n,a,b,c,d = map(int,input().split()) map(int,input().split()) n d = map(int,input().split()) map(int,input().split()) d s = input() input() s b -= 1 1 b ans = "No" "No" ans c -= 1 1 c
n,a,b,c,d = map(int,input().split())
s = input()
a -= 1
b -= 1
c -= 1
d -= 1

def rockcheck(l,r):
    rock = 0
    for i in range(l,r+1):
        if s[i] == "#":
            rock += 1
            if rock == 2:
                print("No")
                exit()
        else: rock = 0
rockcheck(a,c)
rockcheck(b,d)

ans = "No"
if c < d: ans = "Yes"
else:
    for i in range(b,d+1):
        if s[i] == "#": continue
        if s[i-1] == "." and s[i+1] == ".":
            ans = "Yes"
            break
print(ans)