import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n,a,b,c,d = list(map(int, input().split()))
a -= 1
b -= 1
c -= 1
d -= 1
s = input()
if "##" in s[a:c+1]:
    ans = "No"
elif "##" in s[b:d+1]:
    ans = "No"
elif c>d and "..." not in s[b-1:d+2]:
    ans = "No"
else:
    ans = "Yes"
print(ans) import sys sys input = lambda : sys.stdin.readline().rstrip() input lambda : sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip sys.setrecursionlimit(max(1000, 10**9)) sys.setrecursionlimit sys setrecursionlimit max(1000, 10**9) max 1000 10**9 10 9 write = lambda x: sys.stdout.write(x+"\n") write lambda x: sys.stdout.write(x+"\n") sys.stdout.write(x+"\n") sys.stdout.write sys.stdout sys stdout write x+"\n" x "\n" x n,a,b,c,d = list(map(int, input().split())) n list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split a b c d a -= 1 a 1 b -= 1 b 1 c -= 1 c 1 d -= 1 d 1 s = input() s input() input if "##" in s[a:c+1]:
    ans = "No"
elif "##" in s[b:d+1]:
    ans = "No"
elif c>d and "..." not in s[b-1:d+2]:
    ans = "No"
else:
    ans = "Yes" "##" in s[a:c+1] "##" s[a:c+1] s a:c+1 a c+1 c 1 ans = "No" ans "No" elif "##" in s[b:d+1]:
    ans = "No" "##" in s[b:d+1] "##" s[b:d+1] s b:d+1 b d+1 d 1 ans = "No" ans "No" elif c>d and "..." not in s[b-1:d+2]:
    ans = "No" c>d and "..." not in s[b-1:d+2] c>d c d "..." not in s[b-1:d+2] "..." s[b-1:d+2] s b-1:d+2 b-1 b 1 d+2 d 2 ans = "No" ans "No" ans = "Yes" ans "Yes" print(ans) print ans b -= 1 1 b d -= 1 1 d ans = "No" "No" ans s = input() input() s c -= 1 1 c input = lambda : sys.stdin.readline().rstrip() lambda : sys.stdin.readline().rstrip() input b,c,d = list(map(int, input().split())) list(map(int, input().split())) b d = list(map(int, input().split())) list(map(int, input().split())) d write = lambda x: sys.stdout.write(x+"\n") lambda x: sys.stdout.write(x+"\n") write ans = "No" "No" ans n,a,b,c,d = list(map(int, input().split())) list(map(int, input().split())) n ans = "Yes" "Yes" ans a -= 1 1 a a,b,c,d = list(map(int, input().split())) list(map(int, input().split())) a c,d = list(map(int, input().split())) list(map(int, input().split())) c ans = "No" "No" ans
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n,a,b,c,d = list(map(int, input().split()))
a -= 1
b -= 1
c -= 1
d -= 1
s = input()
if "##" in s[a:c+1]:
    ans = "No"
elif "##" in s[b:d+1]:
    ans = "No"
elif c>d and "..." not in s[b-1:d+2]:
    ans = "No"
else:
    ans = "Yes"
print(ans)