import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') #無限大
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(sys.stdin.readline()) #整数読み込み
def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み
def isn(): return sys.stdin.readline().split() #文字列読み込み
def imn(): return map(int, sys.stdin.readline().split()) #整数map取得
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得
def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得
def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD
def print_list(l): print(*l, sep='\n')
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def No(): print('No')

def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

N,A,B,C,D = imn()
S = list(input())

def can_reach(a, b):
    reachable = True
    for i in range(a-1, b-1):
        if S[i] != '#' or S[i+1] != '#': continue
        reachable = False
    return reachable

def takeoverable(a, b):
    cantakeover = False
    for i in range(a-2, b-1):
        if S[i] == '#' or S[i+1] == '#' or S[i+2] == '#': continue
        cantakeover = True
    return cantakeover

ans = True
if C == D:
    ans = False
if not can_reach(A, C) or not can_reach(B, D):
    ans = False
if C > D:
   if not takeoverable(B,D):
       ans = False
print('Yes' if ans else 'No') import math math import fractions fractions import bisect bisect import collections collections import itertools itertools import heapq heapq import string string import sys sys import copy copy from decimal import * from collections import deque sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 MOD = 10**9+7 MOD 10**9+7 10**9 10 9 7 INF = float('inf') INF float('inf') float 'inf' def gcd(a,b):return fractions.gcd(a,b) #最大公約数 gcd a a b b def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数 lcm a a b b def iin(): return int(sys.stdin.readline()) #整数読み込み iin def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み ifn def isn(): return sys.stdin.readline().split() #文字列読み込み isn def imn(): return map(int, sys.stdin.readline().split()) #整数map取得 imn def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得 imnn def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得 fmn def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得 iln def iln_s(): return sorted(iln()) # 昇順の整数リスト取得 iln_s def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得 iln_r def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得 fln def join(l, s=''): return s.join(l) #リストを文字列に変換 join l l s='' s '' def perm(l, n): return itertools.permutations(l, n) # 順列取得 perm l l n n def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数 perm_count n n r r def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得 comb l l n n def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数 comb_count n n r r def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離 two_distance a a b b c c d d def m_add(a,b): return (a+b) % MOD m_add a a b b def print_list(l): print(*l, sep='\n') print_list l l def Yes(): print('Yes') Yes def No(): print('No') No def YES(): print('YES') YES def No(): print('No') No def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime sieves_of_e is_prime = [True] * (n+1) is_prime [True] * (n+1) [True] True n+1 n 1 is_prime[0] = False is_prime[0] is_prime 0 False is_prime[1] = False is_prime[1] is_prime 1 False for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
     i range(2, int(n**0.5)+1) range 2 int(n**0.5)+1 int(n**0.5) int n**0.5 n 0.5 1 if not is_prime[i]: continue
         not is_prime[i] is_prime[i] is_prime i for j in range(i * 2, n+1, i): is_prime[j] = False
     j range(i * 2, n+1, i) range i * 2 i 2 n+1 n 1 i return is_prime is_prime n n N,A,B,C,D = imn() N imn() imn A B C D S = list(input()) S list(input()) list input() input def can_reach(a, b):
    reachable = True
    for i in range(a-1, b-1):
        if S[i] != '#' or S[i+1] != '#': continue
        reachable = False
    return reachable can_reach reachable = True reachable True for i in range(a-1, b-1):
        if S[i] != '#' or S[i+1] != '#': continue
        reachable = False
     i range(a-1, b-1) range a-1 a 1 b-1 b 1 if S[i] != '#' or S[i+1] != '#': continue
         S[i] != '#' or S[i+1] != '#' S[i] != '#' S[i] S i '#' S[i+1] != '#' S[i+1] S i+1 i 1 '#' reachable = False reachable False return reachable reachable a a b b def takeoverable(a, b):
    cantakeover = False
    for i in range(a-2, b-1):
        if S[i] == '#' or S[i+1] == '#' or S[i+2] == '#': continue
        cantakeover = True
    return cantakeover takeoverable cantakeover = False cantakeover False for i in range(a-2, b-1):
        if S[i] == '#' or S[i+1] == '#' or S[i+2] == '#': continue
        cantakeover = True
     i range(a-2, b-1) range a-2 a 2 b-1 b 1 if S[i] == '#' or S[i+1] == '#' or S[i+2] == '#': continue
         S[i] == '#' or S[i+1] == '#' or S[i+2] == '#' S[i] == '#' or S[i+1] == '#' S[i] == '#' S[i] S i '#' S[i+1] == '#' S[i+1] S i+1 i 1 '#' S[i+2] == '#' S[i+2] S i+2 i 2 '#' cantakeover = True cantakeover True return cantakeover cantakeover a a b b ans = True ans True if C == D:
    ans = False C == D C D ans = False ans False if not can_reach(A, C) or not can_reach(B, D):
    ans = False not can_reach(A, C) or not can_reach(B, D) not can_reach(A, C) can_reach(A, C) can_reach A C not can_reach(B, D) can_reach(B, D) can_reach B D ans = False ans False if C > D:
   if not takeoverable(B,D):
       ans = False C > D C D if not takeoverable(B,D):
       ans = False not takeoverable(B,D) takeoverable(B,D) takeoverable B D ans = False ans False print('Yes' if ans else 'No') print 'Yes' if ans else 'No' ans 'Yes' 'No' def join(l, s=''): return s.join(l) #リストを文字列に変換 def join(l, s=''): return s.join(l) #リストを文字列に変換 join def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得 def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得 iln def can_reach(a, b):
    reachable = True
    for i in range(a-1, b-1):
        if S[i] != '#' or S[i+1] != '#': continue
        reachable = False
    return reachable def can_reach(a, b):
    reachable = True
    for i in range(a-1, b-1):
        if S[i] != '#' or S[i+1] != '#': continue
        reachable = False
    return reachable can_reach def iin(): return int(sys.stdin.readline()) #整数読み込み def iin(): return int(sys.stdin.readline()) #整数読み込み iin def m_add(a,b): return (a+b) % MOD def m_add(a,b): return (a+b) % MOD m_add def print_list(l): print(*l, sep='\n') def print_list(l): print(*l, sep='\n') print_list S = list(input()) list(input()) S def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime sieves_of_e B,C,D = imn() imn() B INF = float('inf') float('inf') INF def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離 def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離 two_distance def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得 def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得 comb def iln_s(): return sorted(iln()) # 昇順の整数リスト取得 def iln_s(): return sorted(iln()) # 昇順の整数リスト取得 iln_s def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得 def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得 imnn def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得 def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得 fln N,A,B,C,D = imn() imn() N MOD = 10**9+7 10**9+7 MOD def isn(): return sys.stdin.readline().split() #文字列読み込み def isn(): return sys.stdin.readline().split() #文字列読み込み isn ans = False False ans def gcd(a,b):return fractions.gcd(a,b) #最大公約数 def gcd(a,b):return fractions.gcd(a,b) #最大公約数 gcd def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数 def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数 comb_count def YES(): print('YES') def YES(): print('YES') YES def imn(): return map(int, sys.stdin.readline().split()) #整数map取得 def imn(): return map(int, sys.stdin.readline().split()) #整数map取得 imn ans = False False ans ans = True True ans def No(): print('No') def No(): print('No') No C,D = imn() imn() C ans = False False ans D = imn() imn() D def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数 def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数 lcm def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み ifn def takeoverable(a, b):
    cantakeover = False
    for i in range(a-2, b-1):
        if S[i] == '#' or S[i+1] == '#' or S[i+2] == '#': continue
        cantakeover = True
    return cantakeover def takeoverable(a, b):
    cantakeover = False
    for i in range(a-2, b-1):
        if S[i] == '#' or S[i+1] == '#' or S[i+2] == '#': continue
        cantakeover = True
    return cantakeover takeoverable def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得 def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得 iln_r A,B,C,D = imn() imn() A def perm(l, n): return itertools.permutations(l, n) # 順列取得 def perm(l, n): return itertools.permutations(l, n) # 順列取得 perm def No(): print('No') def No(): print('No') No def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数 def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数 perm_count def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得 def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得 fmn def Yes(): print('Yes') def Yes(): print('Yes') Yes
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') #無限大
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(sys.stdin.readline()) #整数読み込み
def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み
def isn(): return sys.stdin.readline().split() #文字列読み込み
def imn(): return map(int, sys.stdin.readline().split()) #整数map取得
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得
def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得
def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD
def print_list(l): print(*l, sep='\n')
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def No(): print('No')

def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

N,A,B,C,D = imn()
S = list(input())

def can_reach(a, b):
    reachable = True
    for i in range(a-1, b-1):
        if S[i] != '#' or S[i+1] != '#': continue
        reachable = False
    return reachable

def takeoverable(a, b):
    cantakeover = False
    for i in range(a-2, b-1):
        if S[i] == '#' or S[i+1] == '#' or S[i+2] == '#': continue
        cantakeover = True
    return cantakeover

ans = True
if C == D:
    ans = False
if not can_reach(A, C) or not can_reach(B, D):
    ans = False
if C > D:
   if not takeoverable(B,D):
       ans = False
print('Yes' if ans else 'No')