def main():
    N, A, B, C, D = (int(i) for i in input().split())
    S = input()
    if "##" in S[A:C] or "##" in S[B:D]:
        return print("No")
    if D < C and (S[D-2] == "#" or S[D] == "#"):
        if (S[B-2] == "#" or S[B] == "#") and "..." not in S[B-1:D]:
            return print("No")
    print("Yes")


if __name__ == '__main__':
    main() def main():
    N, A, B, C, D = (int(i) for i in input().split())
    S = input()
    if "##" in S[A:C] or "##" in S[B:D]:
        return print("No")
    if D < C and (S[D-2] == "#" or S[D] == "#"):
        if (S[B-2] == "#" or S[B] == "#") and "..." not in S[B-1:D]:
            return print("No")
    print("Yes") main int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i N, A, B, C, D = (int(i) for i in input().split()) N (int(i) for i in input().split()) A B C D S = input() S input() input if "##" in S[A:C] or "##" in S[B:D]:
        return print("No")
     "##" in S[A:C] or "##" in S[B:D] "##" in S[A:C] "##" S[A:C] S A:C A C "##" in S[B:D] "##" S[B:D] S B:D B D return print("No") print("No") print "No" if D < C and (S[D-2] == "#" or S[D] == "#"):
        if (S[B-2] == "#" or S[B] == "#") and "..." not in S[B-1:D]:
            return print("No")
     D < C and (S[D-2] == "#" or S[D] == "#") D < C D C S[D-2] == "#" or S[D] == "#" S[D-2] == "#" S[D-2] S D-2 D 2 "#" S[D] == "#" S[D] S D "#" if (S[B-2] == "#" or S[B] == "#") and "..." not in S[B-1:D]:
            return print("No")
     (S[B-2] == "#" or S[B] == "#") and "..." not in S[B-1:D] S[B-2] == "#" or S[B] == "#" S[B-2] == "#" S[B-2] S B-2 B 2 "#" S[B] == "#" S[B] S B "#" "..." not in S[B-1:D] "..." S[B-1:D] S B-1:D B-1 B 1 D return print("No") print("No") print "No" print("Yes") print "Yes" if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N, A, B, C, D = (int(i) for i in input().split())
    S = input()
    if "##" in S[A:C] or "##" in S[B:D]:
        return print("No")
    if D < C and (S[D-2] == "#" or S[D] == "#"):
        if (S[B-2] == "#" or S[B] == "#") and "..." not in S[B-1:D]:
            return print("No")
    print("Yes") def main():
    N, A, B, C, D = (int(i) for i in input().split())
    S = input()
    if "##" in S[A:C] or "##" in S[B:D]:
        return print("No")
    if D < C and (S[D-2] == "#" or S[D] == "#"):
        if (S[B-2] == "#" or S[B] == "#") and "..." not in S[B-1:D]:
            return print("No")
    print("Yes") main
def main():
    N, A, B, C, D = (int(i) for i in input().split())
    S = input()
    if "##" in S[A:C] or "##" in S[B:D]:
        return print("No")
    if D < C and (S[D-2] == "#" or S[D] == "#"):
        if (S[B-2] == "#" or S[B] == "#") and "..." not in S[B-1:D]:
            return print("No")
    print("Yes")


if __name__ == '__main__':
    main()
