import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

"""
A<Bとする。
C<Dの場合：
A～CとB~Dの間に"##"が無ければ達成できる.
C>Dの場合：
上記に加え、B~Cの間に"..."が存在すれば達成できる
"""

n,a,b,c,d = map(int,readline().split())
s = readline().rstrip().decode('utf-8')
a,b,c,d = a-1,b-1,c-1,d-1

flag = 1
space = 0
res = 0
rock = 0
for i in range(a,c+1):
	if s[i] == "#":
		rock += 1
	else:
		rock = 0
	if rock >= 2:
		flag = 0
for i in range(b,d+1):
	if s[i] == "#":
		rock += 1
	else:
		rock = 0
	if rock >= 2:
		flag = 0
if c > d:
	for i in range(b-1,d+2):
		if s[i] == ".":
			space += 1
		else:
			res = max(res,space)
			space = 0
	res = max(res,space)
	if res < 3:
		flag = 0

print("Yes" if flag else "No") import sys sys readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline def even(n): return 1 if n%2==0 else 0 even n n """
A<Bとする。
C<Dの場合：
A～CとB~Dの間に"##"が無ければ達成できる.
C>Dの場合：
上記に加え、B~Cの間に"..."が存在すれば達成できる
""" n,a,b,c,d = map(int,readline().split()) n map(int,readline().split()) map int readline().split() ().split () readline split a b c d s = readline().rstrip().decode('utf-8') s readline().rstrip().decode('utf-8') ().rstrip().decode ().rstrip() ().rstrip () readline rstrip decode 'utf-8' a,b,c,d = a-1,b-1,c-1,d-1 a a-1 a 1 b b-1 b 1 c c-1 c 1 d d-1 d 1 flag = 1 flag 1 space = 0 space 0 res = 0 res 0 rock = 0 rock 0 for i in range(a,c+1):
	if s[i] == "#":
		rock += 1
	else:
		rock = 0
	if rock >= 2:
		flag = 0 i range(a,c+1) range a c+1 c 1 if s[i] == "#":
		rock += 1
	else:
		rock = 0
	 s[i] == "#" s[i] s i "#" rock += 1 rock 1 rock = 0 rock 0 if rock >= 2:
		flag = 0 rock >= 2 rock 2 flag = 0 flag 0 for i in range(b,d+1):
	if s[i] == "#":
		rock += 1
	else:
		rock = 0
	if rock >= 2:
		flag = 0 i range(b,d+1) range b d+1 d 1 if s[i] == "#":
		rock += 1
	else:
		rock = 0
	 s[i] == "#" s[i] s i "#" rock += 1 rock 1 rock = 0 rock 0 if rock >= 2:
		flag = 0 rock >= 2 rock 2 flag = 0 flag 0 if c > d:
	for i in range(b-1,d+2):
		if s[i] == ".":
			space += 1
		else:
			res = max(res,space)
			space = 0
	res = max(res,space)
	if res < 3:
		flag = 0 c > d c d for i in range(b-1,d+2):
		if s[i] == ".":
			space += 1
		else:
			res = max(res,space)
			space = 0
	 i range(b-1,d+2) range b-1 b 1 d+2 d 2 if s[i] == ".":
			space += 1
		else:
			res = max(res,space)
			space = 0
	 s[i] == "." s[i] s i "." space += 1 space 1 res = max(res,space) res max(res,space) max res space space = 0 space 0 res = max(res,space) res max(res,space) max res space if res < 3:
		flag = 0 res < 3 res 3 flag = 0 flag 0 print("Yes" if flag else "No") print "Yes" if flag else "No" flag "Yes" "No" c,d = map(int,readline().split()) map(int,readline().split()) c b,c,d = map(int,readline().split()) map(int,readline().split()) b flag = 1 1 flag rock += 1 1 rock flag = 0 0 flag readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline c,d = a-1,b-1,c-1,d-1 c-1 c rock = 0 0 rock space = 0 0 space def even(n): return 1 if n%2==0 else 0 def even(n): return 1 if n%2==0 else 0 even res = 0 0 res space = 0 0 space res = max(res,space) max(res,space) res n,a,b,c,d = map(int,readline().split()) map(int,readline().split()) n a,b,c,d = a-1,b-1,c-1,d-1 a-1 a flag = 0 0 flag d = a-1,b-1,c-1,d-1 d-1 d flag = 0 0 flag rock += 1 1 rock rock = 0 0 rock res = max(res,space) max(res,space) res rock = 0 0 rock a,b,c,d = map(int,readline().split()) map(int,readline().split()) a d = map(int,readline().split()) map(int,readline().split()) d s = readline().rstrip().decode('utf-8') readline().rstrip().decode('utf-8') s b,c,d = a-1,b-1,c-1,d-1 b-1 b space += 1 1 space
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

"""
A<Bとする。
C<Dの場合：
A～CとB~Dの間に"##"が無ければ達成できる.
C>Dの場合：
上記に加え、B~Cの間に"..."が存在すれば達成できる
"""

n,a,b,c,d = map(int,readline().split())
s = readline().rstrip().decode('utf-8')
a,b,c,d = a-1,b-1,c-1,d-1

flag = 1
space = 0
res = 0
rock = 0
for i in range(a,c+1):
	if s[i] == "#":
		rock += 1
	else:
		rock = 0
	if rock >= 2:
		flag = 0
for i in range(b,d+1):
	if s[i] == "#":
		rock += 1
	else:
		rock = 0
	if rock >= 2:
		flag = 0
if c > d:
	for i in range(b-1,d+2):
		if s[i] == ".":
			space += 1
		else:
			res = max(res,space)
			space = 0
	res = max(res,space)
	if res < 3:
		flag = 0

print("Yes" if flag else "No")
