N, A, B, C, D = map(int, input().split())
S = input()


def dfs(start, end):
    q = [start-1]
    while q:
        s = q.pop()
        if s==end-1:
            return True
        if s+2<N and S[s+2]==".":
            q.append(s+2)
        if s+1<N and S[s+1]==".":
            q.append(s+1)
    return False


res = dfs(A, C) and dfs(B, D)

if C<D:
    print("Yes" if res else "No")
else:
    #A<B<D<C
    for i in range(B-1, D):
        if S[i-1]=="." and S[i]=="." and S[i+1]==".":
            print("Yes" if res else "No")
            break
    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 S = input() S input() input def dfs(start, end):
    q = [start-1]
    while q:
        s = q.pop()
        if s==end-1:
            return True
        if s+2<N and S[s+2]==".":
            q.append(s+2)
        if s+1<N and S[s+1]==".":
            q.append(s+1)
    return False dfs q = [start-1] q [start-1] start-1 start 1 while q:
        s = q.pop()
        if s==end-1:
            return True
        if s+2<N and S[s+2]==".":
            q.append(s+2)
        if s+1<N and S[s+1]==".":
            q.append(s+1)
     q s = q.pop() s q.pop() q.pop q pop if s==end-1:
            return True
         s==end-1 s end-1 end 1 return True True if s+2<N and S[s+2]==".":
            q.append(s+2)
         s+2<N and S[s+2]=="." s+2<N s+2 s 2 N S[s+2]=="." S[s+2] S s+2 s 2 "." q.append(s+2) q.append q append s+2 s 2 if s+1<N and S[s+1]==".":
            q.append(s+1)
     s+1<N and S[s+1]=="." s+1<N s+1 s 1 N S[s+1]=="." S[s+1] S s+1 s 1 "." q.append(s+1) q.append q append s+1 s 1 return False False start start end end res = dfs(A, C) and dfs(B, D) res dfs(A, C) and dfs(B, D) dfs(A, C) dfs A C dfs(B, D) dfs B D if C<D:
    print("Yes" if res else "No")
else:
    #A<B<D<C
    for i in range(B-1, D):
        if S[i-1]=="." and S[i]=="." and S[i+1]==".":
            print("Yes" if res else "No")
            break
    else:
        print("No") C<D C D print("Yes" if res else "No") print "Yes" if res else "No" res "Yes" "No" for i in range(B-1, D):
        if S[i-1]=="." and S[i]=="." and S[i+1]==".":
            print("Yes" if res else "No")
            break
    else:
        print("No") i range(B-1, D) range B-1 B 1 D if S[i-1]=="." and S[i]=="." and S[i+1]==".":
            print("Yes" if res else "No")
            break
     S[i-1]=="." and S[i]=="." and S[i+1]=="." S[i-1]=="." and S[i]=="." S[i-1]=="." S[i-1] S i-1 i 1 "." S[i]=="." S[i] S i "." S[i+1]=="." S[i+1] S i+1 i 1 "." print("Yes" if res else "No") print "Yes" if res else "No" res "Yes" "No" break print("No") print "No" N, A, B, C, D = map(int, input().split()) map(int, input().split()) N D = map(int, input().split()) map(int, input().split()) D S = input() input() S C, D = map(int, input().split()) map(int, input().split()) C A, B, C, D = map(int, input().split()) map(int, input().split()) A B, C, D = map(int, input().split()) map(int, input().split()) B def dfs(start, end):
    q = [start-1]
    while q:
        s = q.pop()
        if s==end-1:
            return True
        if s+2<N and S[s+2]==".":
            q.append(s+2)
        if s+1<N and S[s+1]==".":
            q.append(s+1)
    return False def dfs(start, end):
    q = [start-1]
    while q:
        s = q.pop()
        if s==end-1:
            return True
        if s+2<N and S[s+2]==".":
            q.append(s+2)
        if s+1<N and S[s+1]==".":
            q.append(s+1)
    return False dfs res = dfs(A, C) and dfs(B, D) dfs(A, C) and dfs(B, D) res
N, A, B, C, D = map(int, input().split())
S = input()


def dfs(start, end):
    q = [start-1]
    while q:
        s = q.pop()
        if s==end-1:
            return True
        if s+2<N and S[s+2]==".":
            q.append(s+2)
        if s+1<N and S[s+1]==".":
            q.append(s+1)
    return False


res = dfs(A, C) and dfs(B, D)

if C<D:
    print("Yes" if res else "No")
else:
    #A<B<D<C
    for i in range(B-1, D):
        if S[i-1]=="." and S[i]=="." and S[i+1]==".":
            print("Yes" if res else "No")
            break
    else:
        print("No")
