import math
import collections
import fractions
import itertools
import functools
import  operator

def solve():
    n, a, b, c, d = map(int, input().split())
    s = input()
    for i in range(a, max(c,d)):
        if s[i-1:i+1] == "##":
            print("No")
            exit()
    if c < d:
        print("Yes")
        exit()
    for i in range(b-1, d):
        if s[i-1:i+2] == "...":
            print("Yes")
            exit()
    print("No")
    return 0

if __name__ == "__main__":
    solve() import math math import collections collections import fractions fractions import itertools itertools import functools functools import  operator operator def solve():
    n, a, b, c, d = map(int, input().split())
    s = input()
    for i in range(a, max(c,d)):
        if s[i-1:i+1] == "##":
            print("No")
            exit()
    if c < d:
        print("Yes")
        exit()
    for i in range(b-1, d):
        if s[i-1:i+2] == "...":
            print("Yes")
            exit()
    print("No")
    return 0 solve n, a, b, c, d = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split a b c d s = input() s input() input for i in range(a, max(c,d)):
        if s[i-1:i+1] == "##":
            print("No")
            exit()
     i range(a, max(c,d)) range a max(c,d) max c d if s[i-1:i+1] == "##":
            print("No")
            exit()
     s[i-1:i+1] == "##" s[i-1:i+1] s i-1:i+1 i-1 i 1 i+1 i 1 "##" print("No") print "No" exit() exit if c < d:
        print("Yes")
        exit()
     c < d c d print("Yes") print "Yes" exit() exit for i in range(b-1, d):
        if s[i-1:i+2] == "...":
            print("Yes")
            exit()
     i range(b-1, d) range b-1 b 1 d if s[i-1:i+2] == "...":
            print("Yes")
            exit()
     s[i-1:i+2] == "..." s[i-1:i+2] s i-1:i+2 i-1 i 1 i+2 i 2 "..." print("Yes") print "Yes" exit() exit print("No") print "No" return 0 0 if __name__ == "__main__":
    solve() __name__ == "__main__" __name__ "__main__" solve() solve def solve():
    n, a, b, c, d = map(int, input().split())
    s = input()
    for i in range(a, max(c,d)):
        if s[i-1:i+1] == "##":
            print("No")
            exit()
    if c < d:
        print("Yes")
        exit()
    for i in range(b-1, d):
        if s[i-1:i+2] == "...":
            print("Yes")
            exit()
    print("No")
    return 0 def solve():
    n, a, b, c, d = map(int, input().split())
    s = input()
    for i in range(a, max(c,d)):
        if s[i-1:i+1] == "##":
            print("No")
            exit()
    if c < d:
        print("Yes")
        exit()
    for i in range(b-1, d):
        if s[i-1:i+2] == "...":
            print("Yes")
            exit()
    print("No")
    return 0 solve
import math
import collections
import fractions
import itertools
import functools
import  operator

def solve():
    n, a, b, c, d = map(int, input().split())
    s = input()
    for i in range(a, max(c,d)):
        if s[i-1:i+1] == "##":
            print("No")
            exit()
    if c < d:
        print("Yes")
        exit()
    for i in range(b-1, d):
        if s[i-1:i+2] == "...":
            print("Yes")
            exit()
    print("No")
    return 0

if __name__ == "__main__":
    solve()