import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

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

def find_route(X,Y):
    for i in range(X,Y):
        if S[i] == S[i + 1] == '#':
            return False
    return True

if C < D:
    if find_route(A,C) and find_route(B,D):
        print('Yes')
    else:
        print('No')
else:
    flag = False
    for i in range(B - 1,D):
        if S[i] == S[i + 1] == S[i + 2] == '.':
            flag = True
            break
    if flag and find_route(A,C):
        print('Yes')
    else:
        print('No')

 import sys sys sys.setrecursionlimit(10000000) sys.setrecursionlimit sys setrecursionlimit 10000000 MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 INF = 10 ** 15 INF 10 ** 15 10 15 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 A -= 1 A 1 B -= 1 B 1 C -= 1 C 1 D -= 1 D 1 def find_route(X,Y):
    for i in range(X,Y):
        if S[i] == S[i + 1] == '#':
            return False
    return True find_route for i in range(X,Y):
        if S[i] == S[i + 1] == '#':
            return False
     i range(X,Y) range X Y if S[i] == S[i + 1] == '#':
            return False
     S[i] == S[i + 1] == '#' S[i] == S[i + 1] S[i] S i S[i + 1] S i + 1 i 1 '#' return False False return True True X X Y Y if C < D:
    if find_route(A,C) and find_route(B,D):
        print('Yes')
    else:
        print('No')
else:
    flag = False
    for i in range(B - 1,D):
        if S[i] == S[i + 1] == S[i + 2] == '.':
            flag = True
            break
    if flag and find_route(A,C):
        print('Yes')
    else:
        print('No') C < D C D if find_route(A,C) and find_route(B,D):
        print('Yes')
    else:
        print('No') find_route(A,C) and find_route(B,D) find_route(A,C) find_route A C find_route(B,D) find_route B D print('Yes') print 'Yes' print('No') print 'No' flag = False flag False for i in range(B - 1,D):
        if S[i] == S[i + 1] == S[i + 2] == '.':
            flag = True
            break
     i range(B - 1,D) range B - 1 B 1 D if S[i] == S[i + 1] == S[i + 2] == '.':
            flag = True
            break
     S[i] == S[i + 1] == S[i + 2] == '.' S[i] == S[i + 1] == S[i + 2] S[i] == S[i + 1] S[i] S i S[i + 1] S i + 1 i 1 S[i + 2] S i + 2 i 2 '.' flag = True flag True break if flag and find_route(A,C):
        print('Yes')
    else:
        print('No') flag and find_route(A,C) flag find_route(A,C) find_route A C print('Yes') print 'Yes' print('No') print 'No' flag = False False flag N,A,B,C,D = map(int,input().split()) map(int,input().split()) N B -= 1 1 B B,C,D = map(int,input().split()) map(int,input().split()) B flag = True True flag def find_route(X,Y):
    for i in range(X,Y):
        if S[i] == S[i + 1] == '#':
            return False
    return True def find_route(X,Y):
    for i in range(X,Y):
        if S[i] == S[i + 1] == '#':
            return False
    return True find_route D = map(int,input().split()) map(int,input().split()) D MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD INF = 10 ** 15 10 ** 15 INF A,B,C,D = map(int,input().split()) map(int,input().split()) A S = input() input() S C -= 1 1 C A -= 1 1 A D -= 1 1 D C,D = map(int,input().split()) map(int,input().split()) C
import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

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

def find_route(X,Y):
    for i in range(X,Y):
        if S[i] == S[i + 1] == '#':
            return False
    return True

if C < D:
    if find_route(A,C) and find_route(B,D):
        print('Yes')
    else:
        print('No')
else:
    flag = False
    for i in range(B - 1,D):
        if S[i] == S[i + 1] == S[i + 2] == '.':
            flag = True
            break
    if flag and find_route(A,C):
        print('Yes')
    else:
        print('No')


