import sys
import re
import math
import collections
import decimal
import bisect
import itertools

import copy

# import heapq
# from collections import deque
# import decimal

# sys.setrecursionlimit(100001)
INF = sys.maxsize
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    n, a, b, c, d = ns()
    a -= 1
    b -= 1
    c -= 1
    d -= 1
    s = list(input())

    stone_twice_flg = True
    for i in range(a, max(c, d)):
        if s[i] == s[i + 1] == "#":
            stone_twice_flg = False
            break

    pass_flg = False
    if c > d:
        for i in range(b, d+1):
            if s[i - 1] == s[i] == s[i + 1] == ".":
                pass_flg = True
                break
    else:
        pass_flg = True

    if stone_twice_flg and pass_flg:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main() import sys sys import re re import math math import collections collections import decimal decimal import bisect bisect import itertools itertools import copy copy INF = sys.maxsize INF sys.maxsize sys maxsize MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 ni = lambda: int(sys.stdin.readline()) ni lambda: int(sys.stdin.readline()) int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline ns = lambda: map(int, sys.stdin.readline().split()) ns lambda: map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split na = lambda: list(map(int, sys.stdin.readline().split())) na lambda: list(map(int, sys.stdin.readline().split())) list(map(int, sys.stdin.readline().split())) list map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split def main():
    n, a, b, c, d = ns()
    a -= 1
    b -= 1
    c -= 1
    d -= 1
    s = list(input())

    stone_twice_flg = True
    for i in range(a, max(c, d)):
        if s[i] == s[i + 1] == "#":
            stone_twice_flg = False
            break

    pass_flg = False
    if c > d:
        for i in range(b, d+1):
            if s[i - 1] == s[i] == s[i + 1] == ".":
                pass_flg = True
                break
    else:
        pass_flg = True

    if stone_twice_flg and pass_flg:
        print("Yes")
    else:
        print("No") main n, a, b, c, d = ns() n ns() ns a b c d a -= 1 a 1 b -= 1 b 1 c -= 1 c 1 d -= 1 d 1 s = list(input()) s list(input()) list input() input stone_twice_flg = True stone_twice_flg True for i in range(a, max(c, d)):
        if s[i] == s[i + 1] == "#":
            stone_twice_flg = False
            break

     i range(a, max(c, d)) range a max(c, d) max c d if s[i] == s[i + 1] == "#":
            stone_twice_flg = False
            break

     s[i] == s[i + 1] == "#" s[i] == s[i + 1] s[i] s i s[i + 1] s i + 1 i 1 "#" stone_twice_flg = False stone_twice_flg False break pass_flg = False pass_flg False if c > d:
        for i in range(b, d+1):
            if s[i - 1] == s[i] == s[i + 1] == ".":
                pass_flg = True
                break
    else:
        pass_flg = True

     c > d c d for i in range(b, d+1):
            if s[i - 1] == s[i] == s[i + 1] == ".":
                pass_flg = True
                break
     i range(b, d+1) range b d+1 d 1 if s[i - 1] == s[i] == s[i + 1] == ".":
                pass_flg = True
                break
     s[i - 1] == s[i] == s[i + 1] == "." s[i - 1] == s[i] == s[i + 1] s[i - 1] == s[i] s[i - 1] s i - 1 i 1 s[i] s i s[i + 1] s i + 1 i 1 "." pass_flg = True pass_flg True break pass_flg = True pass_flg True if stone_twice_flg and pass_flg:
        print("Yes")
    else:
        print("No") stone_twice_flg and pass_flg stone_twice_flg pass_flg print("Yes") print "Yes" print("No") print "No" if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main na = lambda: list(map(int, sys.stdin.readline().split())) lambda: list(map(int, sys.stdin.readline().split())) na def main():
    n, a, b, c, d = ns()
    a -= 1
    b -= 1
    c -= 1
    d -= 1
    s = list(input())

    stone_twice_flg = True
    for i in range(a, max(c, d)):
        if s[i] == s[i + 1] == "#":
            stone_twice_flg = False
            break

    pass_flg = False
    if c > d:
        for i in range(b, d+1):
            if s[i - 1] == s[i] == s[i + 1] == ".":
                pass_flg = True
                break
    else:
        pass_flg = True

    if stone_twice_flg and pass_flg:
        print("Yes")
    else:
        print("No") def main():
    n, a, b, c, d = ns()
    a -= 1
    b -= 1
    c -= 1
    d -= 1
    s = list(input())

    stone_twice_flg = True
    for i in range(a, max(c, d)):
        if s[i] == s[i + 1] == "#":
            stone_twice_flg = False
            break

    pass_flg = False
    if c > d:
        for i in range(b, d+1):
            if s[i - 1] == s[i] == s[i + 1] == ".":
                pass_flg = True
                break
    else:
        pass_flg = True

    if stone_twice_flg and pass_flg:
        print("Yes")
    else:
        print("No") main MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD INF = sys.maxsize sys.maxsize INF ni = lambda: int(sys.stdin.readline()) lambda: int(sys.stdin.readline()) ni ns = lambda: map(int, sys.stdin.readline().split()) lambda: map(int, sys.stdin.readline().split()) ns
import sys
import re
import math
import collections
import decimal
import bisect
import itertools

import copy

# import heapq
# from collections import deque
# import decimal

# sys.setrecursionlimit(100001)
INF = sys.maxsize
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    n, a, b, c, d = ns()
    a -= 1
    b -= 1
    c -= 1
    d -= 1
    s = list(input())

    stone_twice_flg = True
    for i in range(a, max(c, d)):
        if s[i] == s[i + 1] == "#":
            stone_twice_flg = False
            break

    pass_flg = False
    if c > d:
        for i in range(b, d+1):
            if s[i - 1] == s[i] == s[i + 1] == ".":
                pass_flg = True
                break
    else:
        pass_flg = True

    if stone_twice_flg and pass_flg:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
