import sys
from collections import Counter
from collections import deque
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n,a,b,c,d=mp()
s=input()
if s[a-1]=="#" or s[b-1]=="#" or s[c-1]=="#" or s[d-1]=="#":
    print("No")
    exit()
for i in range(min(a,b)-1,max(c,d)):
    if s[i]=="#" and s[i+1]=="#":
        print("No")
        exit()
if d<c:
    ch=False
    for i in range(b-2,d-1):
        if s[i]=="." and s[i+1]=="." and s[i+2]==".":
            ch=True
    if ch:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
else:
    print("Yes") import sys sys from collections import Counter from collections import deque def input(): return sys.stdin.readline().strip() input def mp(): return map(int,input().split()) mp def lmp(): return list(map(int,input().split())) lmp n,a,b,c,d=mp() n mp() mp a b c d s=input() s input() input if s[a-1]=="#" or s[b-1]=="#" or s[c-1]=="#" or s[d-1]=="#":
    print("No")
    exit() s[a-1]=="#" or s[b-1]=="#" or s[c-1]=="#" or s[d-1]=="#" s[a-1]=="#" or s[b-1]=="#" or s[c-1]=="#" s[a-1]=="#" or s[b-1]=="#" s[a-1]=="#" s[a-1] s a-1 a 1 "#" s[b-1]=="#" s[b-1] s b-1 b 1 "#" s[c-1]=="#" s[c-1] s c-1 c 1 "#" s[d-1]=="#" s[d-1] s d-1 d 1 "#" print("No") print "No" exit() exit for i in range(min(a,b)-1,max(c,d)):
    if s[i]=="#" and s[i+1]=="#":
        print("No")
        exit() i range(min(a,b)-1,max(c,d)) range min(a,b)-1 min(a,b) min a b 1 max(c,d) max c d if s[i]=="#" and s[i+1]=="#":
        print("No")
        exit() s[i]=="#" and s[i+1]=="#" s[i]=="#" s[i] s i "#" s[i+1]=="#" s[i+1] s i+1 i 1 "#" print("No") print "No" exit() exit if d<c:
    ch=False
    for i in range(b-2,d-1):
        if s[i]=="." and s[i+1]=="." and s[i+2]==".":
            ch=True
    if ch:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
else:
    print("Yes") d<c d c ch=False ch False for i in range(b-2,d-1):
        if s[i]=="." and s[i+1]=="." and s[i+2]==".":
            ch=True
     i range(b-2,d-1) range b-2 b 2 d-1 d 1 if s[i]=="." and s[i+1]=="." and s[i+2]==".":
            ch=True
     s[i]=="." and s[i+1]=="." and s[i+2]=="." s[i]=="." and s[i+1]=="." s[i]=="." s[i] s i "." s[i+1]=="." s[i+1] s i+1 i 1 "." s[i+2]=="." s[i+2] s i+2 i 2 "." ch=True ch True if ch:
        print("Yes")
        exit()
    else:
        print("No")
        exit() ch print("Yes") print "Yes" exit() exit print("No") print "No" exit() exit print("Yes") print "Yes" c,d=mp() mp() c def mp(): return map(int,input().split()) def mp(): return map(int,input().split()) mp ch=False False ch def input(): return sys.stdin.readline().strip() def input(): return sys.stdin.readline().strip() input def lmp(): return list(map(int,input().split())) def lmp(): return list(map(int,input().split())) lmp d=mp() mp() d b,c,d=mp() mp() b a,b,c,d=mp() mp() a n,a,b,c,d=mp() mp() n s=input() input() s ch=True True ch
import sys
from collections import Counter
from collections import deque
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n,a,b,c,d=mp()
s=input()
if s[a-1]=="#" or s[b-1]=="#" or s[c-1]=="#" or s[d-1]=="#":
    print("No")
    exit()
for i in range(min(a,b)-1,max(c,d)):
    if s[i]=="#" and s[i+1]=="#":
        print("No")
        exit()
if d<c:
    ch=False
    for i in range(b-2,d-1):
        if s[i]=="." and s[i+1]=="." and s[i+2]==".":
            ch=True
    if ch:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
else:
    print("Yes")
