import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7

n,a,b,c,d=map(int,input().split())
s=input()
for i in range(b-1,d-1):
    if s[i]=="#" and s[i+1]=="#":
        print("No")
        quit()

if c<d:
    for i in range(a-1,c-1):
        # print(s[i],s[i+1])
        if s[i]=="#" and s[i+1]=="#":
            print("No")
            quit()

else:
    flag=0
    for i in range(b-2,d-1):
        # print(s[i],s[i+1],s[i+2])
        if s[i]=="." and s[i+1]=="." and s[i+2]==".":
            flag=1
    if flag==0:
        print("No")
        quit()
    for i in range(a-1,c-1):
        if s[i]=="#" and s[i+1]=="#":
            print("No")
            quit()
print("Yes") import sys sys from collections import * import heapq heapq import math math import bisect bisect from itertools import permutations,accumulate,combinations,product from fractions import gcd def input():
    return sys.stdin.readline()[:-1] input return sys.stdin.readline()[:-1] sys.stdin.readline()[:-1] sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline :-1 -1 def ruiseki(lst):
    return [0]+list(accumulate(lst)) ruiseki return [0]+list(accumulate(lst)) [0]+list(accumulate(lst)) [0] 0 list(accumulate(lst)) list accumulate(lst) accumulate lst lst lst mod=pow(10,9)+7 mod pow(10,9)+7 pow(10,9) pow 10 9 7 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 for i in range(b-1,d-1):
    if s[i]=="#" and s[i+1]=="#":
        print("No")
        quit() i range(b-1,d-1) range b-1 b 1 d-1 d 1 if s[i]=="#" and s[i+1]=="#":
        print("No")
        quit() 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" quit() quit if c<d:
    for i in range(a-1,c-1):
        # print(s[i],s[i+1])
        if s[i]=="#" and s[i+1]=="#":
            print("No")
            quit()

else:
    flag=0
    for i in range(b-2,d-1):
        # print(s[i],s[i+1],s[i+2])
        if s[i]=="." and s[i+1]=="." and s[i+2]==".":
            flag=1
    if flag==0:
        print("No")
        quit()
    for i in range(a-1,c-1):
        if s[i]=="#" and s[i+1]=="#":
            print("No")
            quit() c<d c d for i in range(a-1,c-1):
        # print(s[i],s[i+1])
        if s[i]=="#" and s[i+1]=="#":
            print("No")
            quit() i range(a-1,c-1) range a-1 a 1 c-1 c 1 if s[i]=="#" and s[i+1]=="#":
            print("No")
            quit() 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" quit() quit flag=0 flag 0 for i in range(b-2,d-1):
        # print(s[i],s[i+1],s[i+2])
        if s[i]=="." and s[i+1]=="." and s[i+2]==".":
            flag=1
     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]==".":
            flag=1
     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 "." flag=1 flag 1 if flag==0:
        print("No")
        quit()
     flag==0 flag 0 print("No") print "No" quit() quit for i in range(a-1,c-1):
        if s[i]=="#" and s[i+1]=="#":
            print("No")
            quit() i range(a-1,c-1) range a-1 a 1 c-1 c 1 if s[i]=="#" and s[i+1]=="#":
            print("No")
            quit() 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" quit() quit print("Yes") print "Yes" b,c,d=map(int,input().split()) map(int,input().split()) b def input():
    return sys.stdin.readline()[:-1] def input():
    return sys.stdin.readline()[:-1] input a,b,c,d=map(int,input().split()) map(int,input().split()) a c,d=map(int,input().split()) map(int,input().split()) c def ruiseki(lst):
    return [0]+list(accumulate(lst)) def ruiseki(lst):
    return [0]+list(accumulate(lst)) ruiseki s=input() input() s flag=0 0 flag n,a,b,c,d=map(int,input().split()) map(int,input().split()) n d=map(int,input().split()) map(int,input().split()) d flag=1 1 flag mod=pow(10,9)+7 pow(10,9)+7 mod
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7

n,a,b,c,d=map(int,input().split())
s=input()
for i in range(b-1,d-1):
    if s[i]=="#" and s[i+1]=="#":
        print("No")
        quit()

if c<d:
    for i in range(a-1,c-1):
        # print(s[i],s[i+1])
        if s[i]=="#" and s[i+1]=="#":
            print("No")
            quit()

else:
    flag=0
    for i in range(b-2,d-1):
        # print(s[i],s[i+1],s[i+2])
        if s[i]=="." and s[i+1]=="." and s[i+2]==".":
            flag=1
    if flag==0:
        print("No")
        quit()
    for i in range(a-1,c-1):
        if s[i]=="#" and s[i+1]=="#":
            print("No")
            quit()
print("Yes")