import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]

n, a, b, c, d = MAP()
s = STR()

dp1 = [inf for _ in range(n + 1)]
dp1[a] = 0
dp1[a - 1] = 0
for i in range(a + 1,c + 1):
    if s[i - 1] == '.':
        dp1[i] = min(dp1[i - 1], dp1[i - 2]) + 1
dp2 = [inf for _ in range(n + 1)]
dp2[b] = 0
dp2[b - 1] = 0
for i in range(b + 1, d + 1):
    if s[i - 1] == '.':
        dp2[i] = min(dp2[i - 1], dp2[i - 2]) + 1

if a < b and c < d or a > b and c > d:
    if dp1[c] < inf and dp2[d] < inf:
        print('Yes')
    else:
        print('No')
else:
    if a > b and c < d:
        a, b = b, a
        c, d = d, c
    flag = False
    for i in range(b, d + 1): #抜かす場所
        if s[i - 2:i + 1] == '...': #抜かせる
            flag = True
            break
    if dp1[c] < inf and dp2[d] < inf and flag:
        print('Yes')
    else:
        print('No') import sys, re, os sys re os from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin from itertools import permutations, combinations, product, accumulate from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowercase, ascii_uppercase, digits from fractions import gcd def input(): return sys.stdin.readline().strip() input def STR(): return input() STR def INT(): return int(input()) INT def MAP(): return map(int, input().split()) MAP def S_MAP(): return map(str, input().split()) S_MAP def LIST(): return list(map(int, input().split())) LIST def S_LIST(): return list(map(str, input().split())) S_LIST def lcm(a, b): return a * b // gcd(a, b) lcm a a b b sys.setrecursionlimit(10 ** 9) sys.setrecursionlimit sys setrecursionlimit 10 ** 9 10 9 inf = sys.maxsize inf sys.maxsize sys maxsize mod = 10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 dx = [0, 0, 1, -1, 1, -1, -1, 1] dx [0, 0, 1, -1, 1, -1, -1, 1] 0 0 1 -1 1 -1 -1 1 dy = [1, -1, 0, 0, 1, -1, 1, -1] dy [1, -1, 0, 0, 1, -1, 1, -1] 1 -1 0 0 1 -1 1 -1 n, a, b, c, d = MAP() n MAP() MAP a b c d s = STR() s STR() STR inf for _ in range(n + 1) for _ in range(n + 1) _ range(n + 1) range n + 1 n 1 for _ in range(n + 1) inf dp1 = [inf for _ in range(n + 1)] dp1 [inf for _ in range(n + 1)] dp1[a] = 0 dp1[a] dp1 a 0 dp1[a - 1] = 0 dp1[a - 1] dp1 a - 1 a 1 0 for i in range(a + 1,c + 1):
    if s[i - 1] == '.':
        dp1[i] = min(dp1[i - 1], dp1[i - 2]) + 1 i range(a + 1,c + 1) range a + 1 a 1 c + 1 c 1 if s[i - 1] == '.':
        dp1[i] = min(dp1[i - 1], dp1[i - 2]) + 1 s[i - 1] == '.' s[i - 1] s i - 1 i 1 '.' dp1[i] = min(dp1[i - 1], dp1[i - 2]) + 1 dp1[i] dp1 i min(dp1[i - 1], dp1[i - 2]) + 1 min(dp1[i - 1], dp1[i - 2]) min dp1[i - 1] dp1 i - 1 i 1 dp1[i - 2] dp1 i - 2 i 2 1 inf for _ in range(n + 1) for _ in range(n + 1) _ range(n + 1) range n + 1 n 1 for _ in range(n + 1) inf dp2 = [inf for _ in range(n + 1)] dp2 [inf for _ in range(n + 1)] dp2[b] = 0 dp2[b] dp2 b 0 dp2[b - 1] = 0 dp2[b - 1] dp2 b - 1 b 1 0 for i in range(b + 1, d + 1):
    if s[i - 1] == '.':
        dp2[i] = min(dp2[i - 1], dp2[i - 2]) + 1 i range(b + 1, d + 1) range b + 1 b 1 d + 1 d 1 if s[i - 1] == '.':
        dp2[i] = min(dp2[i - 1], dp2[i - 2]) + 1 s[i - 1] == '.' s[i - 1] s i - 1 i 1 '.' dp2[i] = min(dp2[i - 1], dp2[i - 2]) + 1 dp2[i] dp2 i min(dp2[i - 1], dp2[i - 2]) + 1 min(dp2[i - 1], dp2[i - 2]) min dp2[i - 1] dp2 i - 1 i 1 dp2[i - 2] dp2 i - 2 i 2 1 if a < b and c < d or a > b and c > d:
    if dp1[c] < inf and dp2[d] < inf:
        print('Yes')
    else:
        print('No')
else:
    if a > b and c < d:
        a, b = b, a
        c, d = d, c
    flag = False
    for i in range(b, d + 1): #抜かす場所
        if s[i - 2:i + 1] == '...': #抜かせる
            flag = True
            break
    if dp1[c] < inf and dp2[d] < inf and flag:
        print('Yes')
    else:
        print('No') a < b and c < d or a > b and c > d a < b and c < d a < b a b c < d c d a > b and c > d a > b a b c > d c d if dp1[c] < inf and dp2[d] < inf:
        print('Yes')
    else:
        print('No') dp1[c] < inf and dp2[d] < inf dp1[c] < inf dp1[c] dp1 c inf dp2[d] < inf dp2[d] dp2 d inf print('Yes') print 'Yes' print('No') print 'No' if a > b and c < d:
        a, b = b, a
        c, d = d, c
     a > b and c < d a > b a b c < d c d a, b = b, a a b b a c, d = d, c c d d c flag = False flag False for i in range(b, d + 1): #抜かす場所
        if s[i - 2:i + 1] == '...': #抜かせる
            flag = True
            break
     i range(b, d + 1) range b d + 1 d 1 if s[i - 2:i + 1] == '...': #抜かせる
            flag = True
            break
     s[i - 2:i + 1] == '...' s[i - 2:i + 1] s i - 2:i + 1 i - 2 i 2 i + 1 i 1 '...' flag = True flag True break if dp1[c] < inf and dp2[d] < inf and flag:
        print('Yes')
    else:
        print('No') dp1[c] < inf and dp2[d] < inf and flag dp1[c] < inf and dp2[d] < inf dp1[c] < inf dp1[c] dp1 c inf dp2[d] < inf dp2[d] dp2 d inf flag print('Yes') print 'Yes' print('No') print 'No' def LIST(): return list(map(int, input().split())) def LIST(): return list(map(int, input().split())) LIST b, c, d = MAP() MAP() b s = STR() STR() s def lcm(a, b): return a * b // gcd(a, b) def lcm(a, b): return a * b // gcd(a, b) lcm n, a, b, c, d = MAP() MAP() n def STR(): return input() def STR(): return input() STR def INT(): return int(input()) def INT(): return int(input()) INT dy = [1, -1, 0, 0, 1, -1, 1, -1] [1, -1, 0, 0, 1, -1, 1, -1] dy mod = 10 ** 9 + 7 10 ** 9 + 7 mod def MAP(): return map(int, input().split()) def MAP(): return map(int, input().split()) MAP d = MAP() MAP() d flag = False False flag c, d = d, c d c dx = [0, 0, 1, -1, 1, -1, -1, 1] [0, 0, 1, -1, 1, -1, -1, 1] dx def input(): return sys.stdin.readline().strip() def input(): return sys.stdin.readline().strip() input dp2 = [inf for _ in range(n + 1)] [inf for _ in range(n + 1)] dp2 a, b = b, a b a c, d = MAP() MAP() c def S_LIST(): return list(map(str, input().split())) def S_LIST(): return list(map(str, input().split())) S_LIST b = b, a a b def S_MAP(): return map(str, input().split()) def S_MAP(): return map(str, input().split()) S_MAP flag = True True flag inf = sys.maxsize sys.maxsize inf dp1 = [inf for _ in range(n + 1)] [inf for _ in range(n + 1)] dp1 a, b, c, d = MAP() MAP() a d = d, c c d
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]

n, a, b, c, d = MAP()
s = STR()

dp1 = [inf for _ in range(n + 1)]
dp1[a] = 0
dp1[a - 1] = 0
for i in range(a + 1,c + 1):
    if s[i - 1] == '.':
        dp1[i] = min(dp1[i - 1], dp1[i - 2]) + 1
dp2 = [inf for _ in range(n + 1)]
dp2[b] = 0
dp2[b - 1] = 0
for i in range(b + 1, d + 1):
    if s[i - 1] == '.':
        dp2[i] = min(dp2[i - 1], dp2[i - 2]) + 1

if a < b and c < d or a > b and c > d:
    if dp1[c] < inf and dp2[d] < inf:
        print('Yes')
    else:
        print('No')
else:
    if a > b and c < d:
        a, b = b, a
        c, d = d, c
    flag = False
    for i in range(b, d + 1): #抜かす場所
        if s[i - 2:i + 1] == '...': #抜かせる
            flag = True
            break
    if dp1[c] < inf and dp2[d] < inf and flag:
        print('Yes')
    else:
        print('No')
