n,a,b,c,d = map(int, input().split())
a-=1
b-=1
c-=1
d-=1
s = input()
s+='X'
ch=1
v=[]
st=[]
if s[0]=='#':
    v.append((0,0))
for i in range(1,n+1):
    if s[i]==s[i-1]:
        ch+=1
    else:
        v.append((ch,i-ch))
        ch=1
judge=[]
for i in range(len(v)):
    if i%2==1:
        x,y=v[i]
        if x>=2 and ((a < y and y < c) or (b < y and y < d)):
            print('No')
            exit()
    else:
        x,y=v[i]
        if x>=3:
            judge.append((y,y+x-1))
check=1
if (a<b and d<c) or (b<a and c<d):
    check = 0
    while judge:
        t1,t2=judge.pop()
        if t2>a and t2>b and t1<c and t1<d:
            check = 1
if check == 1:
    print('Yes')
else:
    print('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 a-=1 a 1 b-=1 b 1 c-=1 c 1 d-=1 d 1 s = input() s input() input s+='X' s 'X' ch=1 ch 1 v=[] v [] st=[] st [] if s[0]=='#':
    v.append((0,0)) s[0]=='#' s[0] s 0 '#' v.append((0,0)) v.append v append (0,0) 0 0 for i in range(1,n+1):
    if s[i]==s[i-1]:
        ch+=1
    else:
        v.append((ch,i-ch))
        ch=1 i range(1,n+1) range 1 n+1 n 1 if s[i]==s[i-1]:
        ch+=1
    else:
        v.append((ch,i-ch))
        ch=1 s[i]==s[i-1] s[i] s i s[i-1] s i-1 i 1 ch+=1 ch 1 v.append((ch,i-ch)) v.append v append (ch,i-ch) ch i-ch i ch ch=1 ch 1 judge=[] judge [] for i in range(len(v)):
    if i%2==1:
        x,y=v[i]
        if x>=2 and ((a < y and y < c) or (b < y and y < d)):
            print('No')
            exit()
    else:
        x,y=v[i]
        if x>=3:
            judge.append((y,y+x-1)) i range(len(v)) range len(v) len v if i%2==1:
        x,y=v[i]
        if x>=2 and ((a < y and y < c) or (b < y and y < d)):
            print('No')
            exit()
    else:
        x,y=v[i]
        if x>=3:
            judge.append((y,y+x-1)) i%2==1 i%2 i 2 1 x,y=v[i] x v[i] v i y if x>=2 and ((a < y and y < c) or (b < y and y < d)):
            print('No')
            exit()
     x>=2 and ((a < y and y < c) or (b < y and y < d)) x>=2 x 2 (a < y and y < c) or (b < y and y < d) a < y and y < c a < y a y y < c y c b < y and y < d b < y b y y < d y d print('No') print 'No' exit() exit x,y=v[i] x v[i] v i y if x>=3:
            judge.append((y,y+x-1)) x>=3 x 3 judge.append((y,y+x-1)) judge.append judge append (y,y+x-1) y y+x-1 y+x y x 1 check=1 check 1 if (a<b and d<c) or (b<a and c<d):
    check = 0
    while judge:
        t1,t2=judge.pop()
        if t2>a and t2>b and t1<c and t1<d:
            check = 1 (a<b and d<c) or (b<a and c<d) a<b and d<c a<b a b d<c d c b<a and c<d b<a b a c<d c d check = 0 check 0 while judge:
        t1,t2=judge.pop()
        if t2>a and t2>b and t1<c and t1<d:
            check = 1 judge t1,t2=judge.pop() t1 judge.pop() judge.pop judge pop t2 if t2>a and t2>b and t1<c and t1<d:
            check = 1 t2>a and t2>b and t1<c and t1<d t2>a and t2>b and t1<c t2>a and t2>b t2>a t2 a t2>b t2 b t1<c t1 c t1<d t1 d check = 1 check 1 if check == 1:
    print('Yes')
else:
    print('No') check == 1 check 1 print('Yes') print 'Yes' print('No') print 'No' x,y=v[i] v[i] x x,y=v[i] v[i] x check=1 1 check st=[] [] st a-=1 1 a t2=judge.pop() judge.pop() t2 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 y=v[i] v[i] y b-=1 1 b ch+=1 1 ch d = map(int, input().split()) map(int, input().split()) d check = 1 1 check s+='X' 'X' s d-=1 1 d v=[] [] v judge=[] [] judge ch=1 1 ch s = input() input() s check = 0 0 check y=v[i] v[i] y t1,t2=judge.pop() judge.pop() t1 c-=1 1 c ch=1 1 ch b,c,d = map(int, input().split()) map(int, input().split()) b a,b,c,d = map(int, input().split()) map(int, input().split()) a
n,a,b,c,d = map(int, input().split())
a-=1
b-=1
c-=1
d-=1
s = input()
s+='X'
ch=1
v=[]
st=[]
if s[0]=='#':
    v.append((0,0))
for i in range(1,n+1):
    if s[i]==s[i-1]:
        ch+=1
    else:
        v.append((ch,i-ch))
        ch=1
judge=[]
for i in range(len(v)):
    if i%2==1:
        x,y=v[i]
        if x>=2 and ((a < y and y < c) or (b < y and y < d)):
            print('No')
            exit()
    else:
        x,y=v[i]
        if x>=3:
            judge.append((y,y+x-1))
check=1
if (a<b and d<c) or (b<a and c<d):
    check = 0
    while judge:
        t1,t2=judge.pop()
        if t2>a and t2>b and t1<c and t1<d:
            check = 1
if check == 1:
    print('Yes')
else:
    print('No')
