def reach(s, x, y):
    for i in range(x, y-1):
        if s[i] == "#" and s[i+1] == "#":
            return False
    return True
def search(s, x, y):
    for i in range(x-1, y):
        if s[i] == "." and s[i+1] == "." and s[i+2] == ".":
            return True
        if s[i] == "#" and s[i+1] == "#":
            break
    return False

def main():
    n, a, b, c, d = map(int, input().split())
    a -= 1
    b -= 1
    c -= 1
    d -= 1
    s = input().rstrip()
    if reach(s, a, c) and reach(s, b, d):
        if c < d:
            print("Yes")
        else:
            if search(s, b, d):
                print("Yes")
            else:
                print("No")

    else:
        print("No")

if __name__ == "__main__":
    main() def reach(s, x, y):
    for i in range(x, y-1):
        if s[i] == "#" and s[i+1] == "#":
            return False
    return True reach for i in range(x, y-1):
        if s[i] == "#" and s[i+1] == "#":
            return False
     i range(x, y-1) range x y-1 y 1 if s[i] == "#" and s[i+1] == "#":
            return False
     s[i] == "#" and s[i+1] == "#" s[i] == "#" s[i] s i "#" s[i+1] == "#" s[i+1] s i+1 i 1 "#" return False False return True True s s x x y y def search(s, x, y):
    for i in range(x-1, y):
        if s[i] == "." and s[i+1] == "." and s[i+2] == ".":
            return True
        if s[i] == "#" and s[i+1] == "#":
            break
    return False search for i in range(x-1, y):
        if s[i] == "." and s[i+1] == "." and s[i+2] == ".":
            return True
        if s[i] == "#" and s[i+1] == "#":
            break
     i range(x-1, y) range x-1 x 1 y if s[i] == "." and s[i+1] == "." and s[i+2] == ".":
            return True
         s[i] == "." and s[i+1] == "." and s[i+2] == "." s[i] == "." and s[i+1] == "." s[i] == "." s[i] s i "." s[i+1] == "." s[i+1] s i+1 i 1 "." s[i+2] == "." s[i+2] s i+2 i 2 "." return True True if s[i] == "#" and s[i+1] == "#":
            break
     s[i] == "#" and s[i+1] == "#" s[i] == "#" s[i] s i "#" s[i+1] == "#" s[i+1] s i+1 i 1 "#" break return False False s s x x y y def main():
    n, a, b, c, d = map(int, input().split())
    a -= 1
    b -= 1
    c -= 1
    d -= 1
    s = input().rstrip()
    if reach(s, a, c) and reach(s, b, d):
        if c < d:
            print("Yes")
        else:
            if search(s, b, d):
                print("Yes")
            else:
                print("No")

    else:
        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 a -= 1 a 1 b -= 1 b 1 c -= 1 c 1 d -= 1 d 1 s = input().rstrip() s input().rstrip() ().rstrip () input rstrip if reach(s, a, c) and reach(s, b, d):
        if c < d:
            print("Yes")
        else:
            if search(s, b, d):
                print("Yes")
            else:
                print("No")

    else:
        print("No") reach(s, a, c) and reach(s, b, d) reach(s, a, c) reach s a c reach(s, b, d) reach s b d if c < d:
            print("Yes")
        else:
            if search(s, b, d):
                print("Yes")
            else:
                print("No")

     c < d c d print("Yes") print "Yes" if search(s, b, d):
                print("Yes")
            else:
                print("No")

     search(s, b, d) search s b d print("Yes") print "Yes" print("No") print "No" print("No") print "No" if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def search(s, x, y):
    for i in range(x-1, y):
        if s[i] == "." and s[i+1] == "." and s[i+2] == ".":
            return True
        if s[i] == "#" and s[i+1] == "#":
            break
    return False def search(s, x, y):
    for i in range(x-1, y):
        if s[i] == "." and s[i+1] == "." and s[i+2] == ".":
            return True
        if s[i] == "#" and s[i+1] == "#":
            break
    return False search def reach(s, x, y):
    for i in range(x, y-1):
        if s[i] == "#" and s[i+1] == "#":
            return False
    return True def reach(s, x, y):
    for i in range(x, y-1):
        if s[i] == "#" and s[i+1] == "#":
            return False
    return True reach def main():
    n, a, b, c, d = map(int, input().split())
    a -= 1
    b -= 1
    c -= 1
    d -= 1
    s = input().rstrip()
    if reach(s, a, c) and reach(s, b, d):
        if c < d:
            print("Yes")
        else:
            if search(s, b, d):
                print("Yes")
            else:
                print("No")

    else:
        print("No") def main():
    n, a, b, c, d = map(int, input().split())
    a -= 1
    b -= 1
    c -= 1
    d -= 1
    s = input().rstrip()
    if reach(s, a, c) and reach(s, b, d):
        if c < d:
            print("Yes")
        else:
            if search(s, b, d):
                print("Yes")
            else:
                print("No")

    else:
        print("No") main
def reach(s, x, y):
    for i in range(x, y-1):
        if s[i] == "#" and s[i+1] == "#":
            return False
    return True
def search(s, x, y):
    for i in range(x-1, y):
        if s[i] == "." and s[i+1] == "." and s[i+2] == ".":
            return True
        if s[i] == "#" and s[i+1] == "#":
            break
    return False

def main():
    n, a, b, c, d = map(int, input().split())
    a -= 1
    b -= 1
    c -= 1
    d -= 1
    s = input().rstrip()
    if reach(s, a, c) and reach(s, b, d):
        if c < d:
            print("Yes")
        else:
            if search(s, b, d):
                print("Yes")
            else:
                print("No")

    else:
        print("No")

if __name__ == "__main__":
    main()