#!/usr/bin/env python3

n, a, b, c, d = list(map(int, input().split()))
s = list(str(input()))

start = a-1
end = c-1
sharp_count = 0
for i in range(start+1, (end-1)+1):
    if s[i] == "#" and s[i] == s[i+1]:
        print("No")
        exit()

start = b-1
end = d-1
sharp_count = 0
for i in range(start+1, (end-1)+1):
    if s[i] == "#" and s[i] == s[i+1]:
        print("No")
        exit()

if d < c:
    start = b-1
    end = d-1

    flag = 0
    for i in range(start, end+1):
        if s[i-1] == "." and (s[i-1] == s[i]) and (s[i] == s[i+1]):
            flag = 1
    if flag == 0:
        print("No")
        exit()

# if c == d:
#     print("No")
#     exit()
# elif c < b:
#     start = a-1
#     end = c-1

#     sharp_count = 0
#     for i in range(start+1, (end-1)+1):
#         if s[i] == "#" and s[i] == s[i+1]:
#             print("No")
#             exit()

#     start = b-1
#     end = d-1

#     sharp_count = 0
#     for i in range(start+1, (end-1)+1):
#         if s[i] == "#" and s[i] == s[i+1]:
#             print("No")
#             exit()
# elif c < d:
#     start = a-1
#     end = d-1

#     sharp_count = 0
#     for i in range(start+1, (end-1)+1):
#         if s[i] == "#" and s[i] == s[i+1]:
#             print("No")
#             exit()
# elif d < c:
#     start = a-1
#     end = c-1

#     sharp_count = 0
#     for i in range(start+1, (end-1)+1):
#         if s[i] == "#" and s[i] == s[i+1]:
#             print("No")
#             exit()

#     start = b-1
#     end = d-1
#     dot_count = 0
#     count = 0
#     for i in range(start-1, (end+1)+1):
#         if s[i] == ".":
#             count += 1
#         else:
#             dot_count = max(dot_count, count)
#             count = 0
#     if dot_count <= 2:
#         print("No")
#         exit()
print("Yes") 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 s = list(str(input())) s list(str(input())) list str(input()) str input() input start = a-1 start a-1 a 1 end = c-1 end c-1 c 1 sharp_count = 0 sharp_count 0 for i in range(start+1, (end-1)+1):
    if s[i] == "#" and s[i] == s[i+1]:
        print("No")
        exit() i range(start+1, (end-1)+1) range start+1 start 1 (end-1)+1 end-1 end 1 1 if s[i] == "#" and s[i] == s[i+1]:
        print("No")
        exit() s[i] == "#" and s[i] == s[i+1] s[i] == "#" s[i] s i "#" s[i] == s[i+1] s[i] s i s[i+1] s i+1 i 1 print("No") print "No" exit() exit start = b-1 start b-1 b 1 end = d-1 end d-1 d 1 sharp_count = 0 sharp_count 0 for i in range(start+1, (end-1)+1):
    if s[i] == "#" and s[i] == s[i+1]:
        print("No")
        exit() i range(start+1, (end-1)+1) range start+1 start 1 (end-1)+1 end-1 end 1 1 if s[i] == "#" and s[i] == s[i+1]:
        print("No")
        exit() s[i] == "#" and s[i] == s[i+1] s[i] == "#" s[i] s i "#" s[i] == s[i+1] s[i] s i s[i+1] s i+1 i 1 print("No") print "No" exit() exit if d < c:
    start = b-1
    end = d-1

    flag = 0
    for i in range(start, end+1):
        if s[i-1] == "." and (s[i-1] == s[i]) and (s[i] == s[i+1]):
            flag = 1
    if flag == 0:
        print("No")
        exit()

# if c == d:
#     print("No")
#     exit()
# elif c < b:
#     start = a-1
#     end = c-1

#     sharp_count = 0
#     for i in range(start+1, (end-1)+1):
#         if s[i] == "#" and s[i] == s[i+1]:
#             print("No")
#             exit()

#     start = b-1
#     end = d-1

#     sharp_count = 0
#     for i in range(start+1, (end-1)+1):
#         if s[i] == "#" and s[i] == s[i+1]:
#             print("No")
#             exit()
# elif c < d:
#     start = a-1
#     end = d-1

#     sharp_count = 0
#     for i in range(start+1, (end-1)+1):
#         if s[i] == "#" and s[i] == s[i+1]:
#             print("No")
#             exit()
# elif d < c:
#     start = a-1
#     end = c-1

#     sharp_count = 0
#     for i in range(start+1, (end-1)+1):
#         if s[i] == "#" and s[i] == s[i+1]:
#             print("No")
#             exit()

#     start = b-1
#     end = d-1
#     dot_count = 0
#     count = 0
#     for i in range(start-1, (end+1)+1):
#         if s[i] == ".":
#             count += 1
#         else:
#             dot_count = max(dot_count, count)
#             count = 0
#     if dot_count <= 2:
#         print("No")
#         exit() d < c d c start = b-1 start b-1 b 1 end = d-1 end d-1 d 1 flag = 0 flag 0 for i in range(start, end+1):
        if s[i-1] == "." and (s[i-1] == s[i]) and (s[i] == s[i+1]):
            flag = 1
     i range(start, end+1) range start end+1 end 1 if s[i-1] == "." and (s[i-1] == s[i]) and (s[i] == s[i+1]):
            flag = 1
     s[i-1] == "." and (s[i-1] == s[i]) and (s[i] == s[i+1]) s[i-1] == "." and (s[i-1] == s[i]) s[i-1] == "." s[i-1] s i-1 i 1 "." s[i-1] == s[i] s[i-1] s i-1 i 1 s[i] s i s[i] == s[i+1] s[i] s i s[i+1] s i+1 i 1 flag = 1 flag 1 if flag == 0:
        print("No")
        exit()

# if c == d:
#     print("No")
#     exit()
# elif c < b:
#     start = a-1
#     end = c-1

#     sharp_count = 0
#     for i in range(start+1, (end-1)+1):
#         if s[i] == "#" and s[i] == s[i+1]:
#             print("No")
#             exit()

#     start = b-1
#     end = d-1

#     sharp_count = 0
#     for i in range(start+1, (end-1)+1):
#         if s[i] == "#" and s[i] == s[i+1]:
#             print("No")
#             exit()
# elif c < d:
#     start = a-1
#     end = d-1

#     sharp_count = 0
#     for i in range(start+1, (end-1)+1):
#         if s[i] == "#" and s[i] == s[i+1]:
#             print("No")
#             exit()
# elif d < c:
#     start = a-1
#     end = c-1

#     sharp_count = 0
#     for i in range(start+1, (end-1)+1):
#         if s[i] == "#" and s[i] == s[i+1]:
#             print("No")
#             exit()

#     start = b-1
#     end = d-1
#     dot_count = 0
#     count = 0
#     for i in range(start-1, (end+1)+1):
#         if s[i] == ".":
#             count += 1
#         else:
#             dot_count = max(dot_count, count)
#             count = 0
#     if dot_count <= 2:
#         print("No")
#         exit() flag == 0 flag 0 print("No") print "No" exit() exit print("Yes") print "Yes" end = d-1 d-1 end sharp_count = 0 0 sharp_count n, a, b, c, d = list(map(int, input().split())) list(map(int, input().split())) n flag = 0 0 flag a, b, c, d = list(map(int, input().split())) list(map(int, input().split())) a end = c-1 c-1 end flag = 1 1 flag start = a-1 a-1 start start = b-1 b-1 start start = b-1 b-1 start 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 sharp_count = 0 0 sharp_count end = d-1 d-1 end c, d = list(map(int, input().split())) list(map(int, input().split())) c s = list(str(input())) list(str(input())) s
#!/usr/bin/env python3

n, a, b, c, d = list(map(int, input().split()))
s = list(str(input()))

start = a-1
end = c-1
sharp_count = 0
for i in range(start+1, (end-1)+1):
    if s[i] == "#" and s[i] == s[i+1]:
        print("No")
        exit()

start = b-1
end = d-1
sharp_count = 0
for i in range(start+1, (end-1)+1):
    if s[i] == "#" and s[i] == s[i+1]:
        print("No")
        exit()

if d < c:
    start = b-1
    end = d-1

    flag = 0
    for i in range(start, end+1):
        if s[i-1] == "." and (s[i-1] == s[i]) and (s[i] == s[i+1]):
            flag = 1
    if flag == 0:
        print("No")
        exit()

# if c == d:
#     print("No")
#     exit()
# elif c < b:
#     start = a-1
#     end = c-1

#     sharp_count = 0
#     for i in range(start+1, (end-1)+1):
#         if s[i] == "#" and s[i] == s[i+1]:
#             print("No")
#             exit()

#     start = b-1
#     end = d-1

#     sharp_count = 0
#     for i in range(start+1, (end-1)+1):
#         if s[i] == "#" and s[i] == s[i+1]:
#             print("No")
#             exit()
# elif c < d:
#     start = a-1
#     end = d-1

#     sharp_count = 0
#     for i in range(start+1, (end-1)+1):
#         if s[i] == "#" and s[i] == s[i+1]:
#             print("No")
#             exit()
# elif d < c:
#     start = a-1
#     end = c-1

#     sharp_count = 0
#     for i in range(start+1, (end-1)+1):
#         if s[i] == "#" and s[i] == s[i+1]:
#             print("No")
#             exit()

#     start = b-1
#     end = d-1
#     dot_count = 0
#     count = 0
#     for i in range(start-1, (end+1)+1):
#         if s[i] == ".":
#             count += 1
#         else:
#             dot_count = max(dot_count, count)
#             count = 0
#     if dot_count <= 2:
#         print("No")
#         exit()
print("Yes")
