N,A,B,C,D=map(int,input().split())
s=list('.'+input())
def ren(start,end):
    count=0
    MAX=0
    for k in range(start,end+1):
        if s[k]==".":
            count+=1
            MAX=max(count,MAX)
        else:
            count=0
    return MAX>=3


def S(snuke,c):
    while snuke<=c and s[snuke]==".":
        if snuke==c:
            return True
        if s[snuke+1]=='#':
            snuke+=2
        else:
            snuke+=1
    return False

def H(hnuke,d):
    while hnuke<=d and s[hnuke]==".":
        if hnuke==d:
            return True
        if s[hnuke+1]=='#':
            hnuke+=2
        else:
            hnuke+=1
    return False


x=S(A,C)
y=H(B,D)

if (B<A and C<D):
    z= x and y and ren(A-1,C+1)

elif (A<B and D<C):
    z= x and y and ren(B-1,D+1)
else:
    z= x and y
print("Yes" if z else "No") 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=list('.'+input()) s list('.'+input()) list '.'+input() '.' input() input def ren(start,end):
    count=0
    MAX=0
    for k in range(start,end+1):
        if s[k]==".":
            count+=1
            MAX=max(count,MAX)
        else:
            count=0
    return MAX>=3 ren count=0 count 0 MAX=0 MAX 0 for k in range(start,end+1):
        if s[k]==".":
            count+=1
            MAX=max(count,MAX)
        else:
            count=0
     k range(start,end+1) range start end+1 end 1 if s[k]==".":
            count+=1
            MAX=max(count,MAX)
        else:
            count=0
     s[k]=="." s[k] s k "." count+=1 count 1 MAX=max(count,MAX) MAX max(count,MAX) max count MAX count=0 count 0 return MAX>=3 MAX>=3 MAX 3 start start end end def S(snuke,c):
    while snuke<=c and s[snuke]==".":
        if snuke==c:
            return True
        if s[snuke+1]=='#':
            snuke+=2
        else:
            snuke+=1
    return False S while snuke<=c and s[snuke]==".":
        if snuke==c:
            return True
        if s[snuke+1]=='#':
            snuke+=2
        else:
            snuke+=1
     snuke<=c and s[snuke]=="." snuke<=c snuke c s[snuke]=="." s[snuke] s snuke "." if snuke==c:
            return True
         snuke==c snuke c return True True if s[snuke+1]=='#':
            snuke+=2
        else:
            snuke+=1
     s[snuke+1]=='#' s[snuke+1] s snuke+1 snuke 1 '#' snuke+=2 snuke 2 snuke+=1 snuke 1 return False False snuke snuke c c def H(hnuke,d):
    while hnuke<=d and s[hnuke]==".":
        if hnuke==d:
            return True
        if s[hnuke+1]=='#':
            hnuke+=2
        else:
            hnuke+=1
    return False H while hnuke<=d and s[hnuke]==".":
        if hnuke==d:
            return True
        if s[hnuke+1]=='#':
            hnuke+=2
        else:
            hnuke+=1
     hnuke<=d and s[hnuke]=="." hnuke<=d hnuke d s[hnuke]=="." s[hnuke] s hnuke "." if hnuke==d:
            return True
         hnuke==d hnuke d return True True if s[hnuke+1]=='#':
            hnuke+=2
        else:
            hnuke+=1
     s[hnuke+1]=='#' s[hnuke+1] s hnuke+1 hnuke 1 '#' hnuke+=2 hnuke 2 hnuke+=1 hnuke 1 return False False hnuke hnuke d d x=S(A,C) x S(A,C) S A C y=H(B,D) y H(B,D) H B D if (B<A and C<D):
    z= x and y and ren(A-1,C+1)

elif (A<B and D<C):
    z= x and y and ren(B-1,D+1)
else:
    z= x and y B<A and C<D B<A B A C<D C D z= x and y and ren(A-1,C+1) z x and y and ren(A-1,C+1) x and y x y ren(A-1,C+1) ren A-1 A 1 C+1 C 1 elif (A<B and D<C):
    z= x and y and ren(B-1,D+1) A<B and D<C A<B A B D<C D C z= x and y and ren(B-1,D+1) z x and y and ren(B-1,D+1) x and y x y ren(B-1,D+1) ren B-1 B 1 D+1 D 1 z= x and y z x and y x y print("Yes" if z else "No") print "Yes" if z else "No" z "Yes" "No" y=H(B,D) H(B,D) y C,D=map(int,input().split()) map(int,input().split()) C def S(snuke,c):
    while snuke<=c and s[snuke]==".":
        if snuke==c:
            return True
        if s[snuke+1]=='#':
            snuke+=2
        else:
            snuke+=1
    return False def S(snuke,c):
    while snuke<=c and s[snuke]==".":
        if snuke==c:
            return True
        if s[snuke+1]=='#':
            snuke+=2
        else:
            snuke+=1
    return False S N,A,B,C,D=map(int,input().split()) map(int,input().split()) N s=list('.'+input()) list('.'+input()) s B,C,D=map(int,input().split()) map(int,input().split()) B def H(hnuke,d):
    while hnuke<=d and s[hnuke]==".":
        if hnuke==d:
            return True
        if s[hnuke+1]=='#':
            hnuke+=2
        else:
            hnuke+=1
    return False def H(hnuke,d):
    while hnuke<=d and s[hnuke]==".":
        if hnuke==d:
            return True
        if s[hnuke+1]=='#':
            hnuke+=2
        else:
            hnuke+=1
    return False H A,B,C,D=map(int,input().split()) map(int,input().split()) A z= x and y and ren(A-1,C+1) x and y and ren(A-1,C+1) z z= x and y and ren(B-1,D+1) x and y and ren(B-1,D+1) z z= x and y x and y z def ren(start,end):
    count=0
    MAX=0
    for k in range(start,end+1):
        if s[k]==".":
            count+=1
            MAX=max(count,MAX)
        else:
            count=0
    return MAX>=3 def ren(start,end):
    count=0
    MAX=0
    for k in range(start,end+1):
        if s[k]==".":
            count+=1
            MAX=max(count,MAX)
        else:
            count=0
    return MAX>=3 ren x=S(A,C) S(A,C) x D=map(int,input().split()) map(int,input().split()) D
N,A,B,C,D=map(int,input().split())
s=list('.'+input())
def ren(start,end):
    count=0
    MAX=0
    for k in range(start,end+1):
        if s[k]==".":
            count+=1
            MAX=max(count,MAX)
        else:
            count=0
    return MAX>=3


def S(snuke,c):
    while snuke<=c and s[snuke]==".":
        if snuke==c:
            return True
        if s[snuke+1]=='#':
            snuke+=2
        else:
            snuke+=1
    return False

def H(hnuke,d):
    while hnuke<=d and s[hnuke]==".":
        if hnuke==d:
            return True
        if s[hnuke+1]=='#':
            hnuke+=2
        else:
            hnuke+=1
    return False


x=S(A,C)
y=H(B,D)

if (B<A and C<D):
    z= x and y and ren(A-1,C+1)

elif (A<B and D<C):
    z= x and y and ren(B-1,D+1)
else:
    z= x and y
print("Yes" if z else "No")