#ランレングス圧縮
def rle_comp(S):
    rle = []
    pre = 'X'
    chain = 1
    for c in S:
        if c == pre:
            chain += 1
        else:
            if pre != 'X':
                rle.append([pre,chain])
            
            pre = c
            chain = 1
    rle.append([pre,chain])

    #print(rle)
    return rle

N,A,B,C,D = map(int,input().split())
S = input()
#S = S[:A-1] + 'A' + S[A:]
#S = S[:B-1] + 'B' + S[B:]
#print(S)
ans = "Yes"
#すぬけ君がふぬけ君を2マスジャンプで追い越しが不要な場合
if C < D:
    rle = rle_comp(S[A-1:D])
    for i in range(len(rle)):
        #2マスジャンプで岩をやりすごせるか判定
        if rle[i][0] == '#' and rle[i][1] >= 2:
            ans = "No"
#すぬけ君がふぬけ君を2マスジャンプで追い越しが必要な場合
else:
    rle = rle_comp(S[A-1:C])
    for i in range(len(rle)):
        #2マスジャンプで岩をやりすごせるか判定
        if rle[i][0] == '#' and rle[i][1] >= 2:
            ans = "No"

    space = False
    #ふぬけ君がスタート地点またはゴール地点にいる状態で追い越しをする場合を考慮するため
    #範囲を1つずつ広げる
    rle = rle_comp(S[B-2:D+1])
    for i in range(len(rle)):
        #追い越しができるか判定
        if rle[i][0] == '.' and rle[i][1] >= 3:
            space = True
    
    if space == False:
        ans = "No"

print(ans) def rle_comp(S):
    rle = []
    pre = 'X'
    chain = 1
    for c in S:
        if c == pre:
            chain += 1
        else:
            if pre != 'X':
                rle.append([pre,chain])
            
            pre = c
            chain = 1
    rle.append([pre,chain])

    #print(rle)
    return rle rle_comp rle = [] rle [] pre = 'X' pre 'X' chain = 1 chain 1 for c in S:
        if c == pre:
            chain += 1
        else:
            if pre != 'X':
                rle.append([pre,chain])
            
            pre = c
            chain = 1
     c S if c == pre:
            chain += 1
        else:
            if pre != 'X':
                rle.append([pre,chain])
            
            pre = c
            chain = 1
     c == pre c pre chain += 1 chain 1 if pre != 'X':
                rle.append([pre,chain])
            
             pre != 'X' pre 'X' rle.append([pre,chain]) rle.append rle append [pre,chain] pre chain pre = c pre c chain = 1 chain 1 rle.append([pre,chain]) rle.append rle append [pre,chain] pre chain return rle rle S S 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 ans = "Yes" ans "Yes" if C < D:
    rle = rle_comp(S[A-1:D])
    for i in range(len(rle)):
        #2マスジャンプで岩をやりすごせるか判定
        if rle[i][0] == '#' and rle[i][1] >= 2:
            ans = "No"
#すぬけ君がふぬけ君を2マスジャンプで追い越しが必要な場合
else:
    rle = rle_comp(S[A-1:C])
    for i in range(len(rle)):
        #2マスジャンプで岩をやりすごせるか判定
        if rle[i][0] == '#' and rle[i][1] >= 2:
            ans = "No"

    space = False
    #ふぬけ君がスタート地点またはゴール地点にいる状態で追い越しをする場合を考慮するため
    #範囲を1つずつ広げる
    rle = rle_comp(S[B-2:D+1])
    for i in range(len(rle)):
        #追い越しができるか判定
        if rle[i][0] == '.' and rle[i][1] >= 3:
            space = True
    
    if space == False:
        ans = "No" C < D C D rle = rle_comp(S[A-1:D]) rle rle_comp(S[A-1:D]) rle_comp S[A-1:D] S A-1:D A-1 A 1 D for i in range(len(rle)):
        #2マスジャンプで岩をやりすごせるか判定
        if rle[i][0] == '#' and rle[i][1] >= 2:
            ans = "No"
#すぬけ君がふぬけ君を2マスジャンプで追い越しが必要な場合 i range(len(rle)) range len(rle) len rle if rle[i][0] == '#' and rle[i][1] >= 2:
            ans = "No"
#すぬけ君がふぬけ君を2マスジャンプで追い越しが必要な場合 rle[i][0] == '#' and rle[i][1] >= 2 rle[i][0] == '#' rle[i][0] [i] rle i 0 '#' rle[i][1] >= 2 rle[i][1] [i] rle i 1 2 ans = "No" ans "No" rle = rle_comp(S[A-1:C]) rle rle_comp(S[A-1:C]) rle_comp S[A-1:C] S A-1:C A-1 A 1 C for i in range(len(rle)):
        #2マスジャンプで岩をやりすごせるか判定
        if rle[i][0] == '#' and rle[i][1] >= 2:
            ans = "No"

     i range(len(rle)) range len(rle) len rle if rle[i][0] == '#' and rle[i][1] >= 2:
            ans = "No"

     rle[i][0] == '#' and rle[i][1] >= 2 rle[i][0] == '#' rle[i][0] [i] rle i 0 '#' rle[i][1] >= 2 rle[i][1] [i] rle i 1 2 ans = "No" ans "No" space = False space False rle = rle_comp(S[B-2:D+1]) rle rle_comp(S[B-2:D+1]) rle_comp S[B-2:D+1] S B-2:D+1 B-2 B 2 D+1 D 1 for i in range(len(rle)):
        #追い越しができるか判定
        if rle[i][0] == '.' and rle[i][1] >= 3:
            space = True
    
     i range(len(rle)) range len(rle) len rle if rle[i][0] == '.' and rle[i][1] >= 3:
            space = True
    
     rle[i][0] == '.' and rle[i][1] >= 3 rle[i][0] == '.' rle[i][0] [i] rle i 0 '.' rle[i][1] >= 3 rle[i][1] [i] rle i 1 3 space = True space True if space == False:
        ans = "No" space == False space False ans = "No" ans "No" print(ans) print ans ans = "No" "No" ans def rle_comp(S):
    rle = []
    pre = 'X'
    chain = 1
    for c in S:
        if c == pre:
            chain += 1
        else:
            if pre != 'X':
                rle.append([pre,chain])
            
            pre = c
            chain = 1
    rle.append([pre,chain])

    #print(rle)
    return rle def rle_comp(S):
    rle = []
    pre = 'X'
    chain = 1
    for c in S:
        if c == pre:
            chain += 1
        else:
            if pre != 'X':
                rle.append([pre,chain])
            
            pre = c
            chain = 1
    rle.append([pre,chain])

    #print(rle)
    return rle rle_comp space = True True space space = False False space B,C,D = map(int,input().split()) map(int,input().split()) B S = input() input() S A,B,C,D = map(int,input().split()) map(int,input().split()) A D = map(int,input().split()) map(int,input().split()) D C,D = map(int,input().split()) map(int,input().split()) C ans = "Yes" "Yes" ans rle = rle_comp(S[B-2:D+1]) rle_comp(S[B-2:D+1]) rle ans = "No" "No" ans rle = rle_comp(S[A-1:C]) rle_comp(S[A-1:C]) rle N,A,B,C,D = map(int,input().split()) map(int,input().split()) N ans = "No" "No" ans rle = rle_comp(S[A-1:D]) rle_comp(S[A-1:D]) rle
#ランレングス圧縮
def rle_comp(S):
    rle = []
    pre = 'X'
    chain = 1
    for c in S:
        if c == pre:
            chain += 1
        else:
            if pre != 'X':
                rle.append([pre,chain])
            
            pre = c
            chain = 1
    rle.append([pre,chain])

    #print(rle)
    return rle

N,A,B,C,D = map(int,input().split())
S = input()
#S = S[:A-1] + 'A' + S[A:]
#S = S[:B-1] + 'B' + S[B:]
#print(S)
ans = "Yes"
#すぬけ君がふぬけ君を2マスジャンプで追い越しが不要な場合
if C < D:
    rle = rle_comp(S[A-1:D])
    for i in range(len(rle)):
        #2マスジャンプで岩をやりすごせるか判定
        if rle[i][0] == '#' and rle[i][1] >= 2:
            ans = "No"
#すぬけ君がふぬけ君を2マスジャンプで追い越しが必要な場合
else:
    rle = rle_comp(S[A-1:C])
    for i in range(len(rle)):
        #2マスジャンプで岩をやりすごせるか判定
        if rle[i][0] == '#' and rle[i][1] >= 2:
            ans = "No"

    space = False
    #ふぬけ君がスタート地点またはゴール地点にいる状態で追い越しをする場合を考慮するため
    #範囲を1つずつ広げる
    rle = rle_comp(S[B-2:D+1])
    for i in range(len(rle)):
        #追い越しができるか判定
        if rle[i][0] == '.' and rle[i][1] >= 3:
            space = True
    
    if space == False:
        ans = "No"

print(ans)