import sys
import math


def input():
    return sys.stdin.readline().rstrip()


def main():
    N, A, B, C, D = map(int, input().split())
    S = input()
    flag = 0
    b=B
    a =A
    while A < C:
        if flag ==1 and S[A]=="#":
            print("No")
            exit()
        elif S[A] =="#":
            flag =1
        else:
            flag =0

        A +=1

    while B < D:
        if flag ==1 and S[B]=="#":
            print("No")
            exit()
        elif S[B] =="#":
            flag =1
        else:
            flag =0

        B +=1

    if C>D:
        j=b-1
        while j<D:
            if S[j-1]=="." and S[j]=="." and S[j+1]==".":
                print("Yes")
                exit()
            j+=1
        print("No")
        exit()
    else:
        print("Yes")




if __name__ == "__main__":
    main() import sys sys import math math def input():
    return sys.stdin.readline().rstrip() input return sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def main():
    N, A, B, C, D = map(int, input().split())
    S = input()
    flag = 0
    b=B
    a =A
    while A < C:
        if flag ==1 and S[A]=="#":
            print("No")
            exit()
        elif S[A] =="#":
            flag =1
        else:
            flag =0

        A +=1

    while B < D:
        if flag ==1 and S[B]=="#":
            print("No")
            exit()
        elif S[B] =="#":
            flag =1
        else:
            flag =0

        B +=1

    if C>D:
        j=b-1
        while j<D:
            if S[j-1]=="." and S[j]=="." and S[j+1]==".":
                print("Yes")
                exit()
            j+=1
        print("No")
        exit()
    else:
        print("Yes") main 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 flag = 0 flag 0 b=B b B a =A a A while A < C:
        if flag ==1 and S[A]=="#":
            print("No")
            exit()
        elif S[A] =="#":
            flag =1
        else:
            flag =0

        A +=1

     A < C A C if flag ==1 and S[A]=="#":
            print("No")
            exit()
        elif S[A] =="#":
            flag =1
        else:
            flag =0

         flag ==1 and S[A]=="#" flag ==1 flag 1 S[A]=="#" S[A] S A "#" print("No") print "No" exit() exit elif S[A] =="#":
            flag =1
         S[A] =="#" S[A] S A "#" flag =1 flag 1 flag =0 flag 0 A +=1 A 1 while B < D:
        if flag ==1 and S[B]=="#":
            print("No")
            exit()
        elif S[B] =="#":
            flag =1
        else:
            flag =0

        B +=1

     B < D B D if flag ==1 and S[B]=="#":
            print("No")
            exit()
        elif S[B] =="#":
            flag =1
        else:
            flag =0

         flag ==1 and S[B]=="#" flag ==1 flag 1 S[B]=="#" S[B] S B "#" print("No") print "No" exit() exit elif S[B] =="#":
            flag =1
         S[B] =="#" S[B] S B "#" flag =1 flag 1 flag =0 flag 0 B +=1 B 1 if C>D:
        j=b-1
        while j<D:
            if S[j-1]=="." and S[j]=="." and S[j+1]==".":
                print("Yes")
                exit()
            j+=1
        print("No")
        exit()
    else:
        print("Yes") C>D C D j=b-1 j b-1 b 1 while j<D:
            if S[j-1]=="." and S[j]=="." and S[j+1]==".":
                print("Yes")
                exit()
            j+=1
         j<D j D if S[j-1]=="." and S[j]=="." and S[j+1]==".":
                print("Yes")
                exit()
             S[j-1]=="." and S[j]=="." and S[j+1]=="." S[j-1]=="." and S[j]=="." S[j-1]=="." S[j-1] S j-1 j 1 "." S[j]=="." S[j] S j "." S[j+1]=="." S[j+1] S j+1 j 1 "." print("Yes") print "Yes" exit() exit j+=1 j 1 print("No") print "No" exit() exit print("Yes") print "Yes" if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    N, A, B, C, D = map(int, input().split())
    S = input()
    flag = 0
    b=B
    a =A
    while A < C:
        if flag ==1 and S[A]=="#":
            print("No")
            exit()
        elif S[A] =="#":
            flag =1
        else:
            flag =0

        A +=1

    while B < D:
        if flag ==1 and S[B]=="#":
            print("No")
            exit()
        elif S[B] =="#":
            flag =1
        else:
            flag =0

        B +=1

    if C>D:
        j=b-1
        while j<D:
            if S[j-1]=="." and S[j]=="." and S[j+1]==".":
                print("Yes")
                exit()
            j+=1
        print("No")
        exit()
    else:
        print("Yes") def main():
    N, A, B, C, D = map(int, input().split())
    S = input()
    flag = 0
    b=B
    a =A
    while A < C:
        if flag ==1 and S[A]=="#":
            print("No")
            exit()
        elif S[A] =="#":
            flag =1
        else:
            flag =0

        A +=1

    while B < D:
        if flag ==1 and S[B]=="#":
            print("No")
            exit()
        elif S[B] =="#":
            flag =1
        else:
            flag =0

        B +=1

    if C>D:
        j=b-1
        while j<D:
            if S[j-1]=="." and S[j]=="." and S[j+1]==".":
                print("Yes")
                exit()
            j+=1
        print("No")
        exit()
    else:
        print("Yes") main def input():
    return sys.stdin.readline().rstrip() def input():
    return sys.stdin.readline().rstrip() input
import sys
import math


def input():
    return sys.stdin.readline().rstrip()


def main():
    N, A, B, C, D = map(int, input().split())
    S = input()
    flag = 0
    b=B
    a =A
    while A < C:
        if flag ==1 and S[A]=="#":
            print("No")
            exit()
        elif S[A] =="#":
            flag =1
        else:
            flag =0

        A +=1

    while B < D:
        if flag ==1 and S[B]=="#":
            print("No")
            exit()
        elif S[B] =="#":
            flag =1
        else:
            flag =0

        B +=1

    if C>D:
        j=b-1
        while j<D:
            if S[j-1]=="." and S[j]=="." and S[j+1]==".":
                print("Yes")
                exit()
            j+=1
        print("No")
        exit()
    else:
        print("Yes")




if __name__ == "__main__":
    main()
