import sys
input = sys.stdin.readline


def log(*args):
    print(*args, file=sys.stderr)


def main():
    N, A, B, C, D = map(int, input().split())
    log(N, A, B, C, D)
    S = input()
    if "##" in S[A-1:max(D, C)]:
        print("No")
        return
    if C < D:
        print("Yes")
        return
    log(S[B-2:D+1])
    if "..." in S[B-2:D+1]:
        print("Yes")
        return
    print("No")


if __name__ == '__main__':
    main() import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def log(*args):
    print(*args, file=sys.stderr) log print(*args, file=sys.stderr) print *args args file=sys.stderr file sys.stderr sys stderr *args def main():
    N, A, B, C, D = map(int, input().split())
    log(N, A, B, C, D)
    S = input()
    if "##" in S[A-1:max(D, C)]:
        print("No")
        return
    if C < D:
        print("Yes")
        return
    log(S[B-2:D+1])
    if "..." in S[B-2:D+1]:
        print("Yes")
        return
    print("No") 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 log(N, A, B, C, D) log N A B C D S = input() S input() input if "##" in S[A-1:max(D, C)]:
        print("No")
        return
     "##" in S[A-1:max(D, C)] "##" S[A-1:max(D, C)] S A-1:max(D, C) A-1 A 1 max(D, C) max D C print("No") print "No" return if C < D:
        print("Yes")
        return
     C < D C D print("Yes") print "Yes" return log(S[B-2:D+1]) log S[B-2:D+1] S B-2:D+1 B-2 B 2 D+1 D 1 if "..." in S[B-2:D+1]:
        print("Yes")
        return
     "..." in S[B-2:D+1] "..." S[B-2:D+1] S B-2:D+1 B-2 B 2 D+1 D 1 print("Yes") print "Yes" return print("No") print "No" if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N, A, B, C, D = map(int, input().split())
    log(N, A, B, C, D)
    S = input()
    if "##" in S[A-1:max(D, C)]:
        print("No")
        return
    if C < D:
        print("Yes")
        return
    log(S[B-2:D+1])
    if "..." in S[B-2:D+1]:
        print("Yes")
        return
    print("No") def main():
    N, A, B, C, D = map(int, input().split())
    log(N, A, B, C, D)
    S = input()
    if "##" in S[A-1:max(D, C)]:
        print("No")
        return
    if C < D:
        print("Yes")
        return
    log(S[B-2:D+1])
    if "..." in S[B-2:D+1]:
        print("Yes")
        return
    print("No") main input = sys.stdin.readline sys.stdin.readline input def log(*args):
    print(*args, file=sys.stderr) def log(*args):
    print(*args, file=sys.stderr) log
import sys
input = sys.stdin.readline


def log(*args):
    print(*args, file=sys.stderr)


def main():
    N, A, B, C, D = map(int, input().split())
    log(N, A, B, C, D)
    S = input()
    if "##" in S[A-1:max(D, C)]:
        print("No")
        return
    if C < D:
        print("Yes")
        return
    log(S[B-2:D+1])
    if "..." in S[B-2:D+1]:
        print("Yes")
        return
    print("No")


if __name__ == '__main__':
    main()
