def main():
    length, snuke_start, hnuke_start, snuke_goal, hnuke_goal = map(lambda x: int(x) - 1, input().split())
    grid = input()
    is_rock_continuing = False
    is_space_continuing = False
    if "##" in grid[min(snuke_start, hnuke_goal):max(snuke_goal, hnuke_goal) + 1]:
        is_rock_continuing = True
    if "..." in grid[hnuke_start - 1:hnuke_goal + 2]:
        is_space_continuing = True
    if snuke_goal < hnuke_goal and not is_rock_continuing:
        print("Yes")
    elif hnuke_goal < snuke_goal and not is_rock_continuing and is_space_continuing:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
 def main():
    length, snuke_start, hnuke_start, snuke_goal, hnuke_goal = map(lambda x: int(x) - 1, input().split())
    grid = input()
    is_rock_continuing = False
    is_space_continuing = False
    if "##" in grid[min(snuke_start, hnuke_goal):max(snuke_goal, hnuke_goal) + 1]:
        is_rock_continuing = True
    if "..." in grid[hnuke_start - 1:hnuke_goal + 2]:
        is_space_continuing = True
    if snuke_goal < hnuke_goal and not is_rock_continuing:
        print("Yes")
    elif hnuke_goal < snuke_goal and not is_rock_continuing and is_space_continuing:
        print("Yes")
    else:
        print("No") main length, snuke_start, hnuke_start, snuke_goal, hnuke_goal = map(lambda x: int(x) - 1, input().split()) length map(lambda x: int(x) - 1, input().split()) map lambda x: int(x) - 1 int(x) - 1 int(x) int x 1 x input().split() ().split () input split snuke_start hnuke_start snuke_goal hnuke_goal grid = input() grid input() input is_rock_continuing = False is_rock_continuing False is_space_continuing = False is_space_continuing False if "##" in grid[min(snuke_start, hnuke_goal):max(snuke_goal, hnuke_goal) + 1]:
        is_rock_continuing = True
     "##" in grid[min(snuke_start, hnuke_goal):max(snuke_goal, hnuke_goal) + 1] "##" grid[min(snuke_start, hnuke_goal):max(snuke_goal, hnuke_goal) + 1] grid min(snuke_start, hnuke_goal):max(snuke_goal, hnuke_goal) + 1 min(snuke_start, hnuke_goal) min snuke_start hnuke_goal max(snuke_goal, hnuke_goal) + 1 max(snuke_goal, hnuke_goal) max snuke_goal hnuke_goal 1 is_rock_continuing = True is_rock_continuing True if "..." in grid[hnuke_start - 1:hnuke_goal + 2]:
        is_space_continuing = True
     "..." in grid[hnuke_start - 1:hnuke_goal + 2] "..." grid[hnuke_start - 1:hnuke_goal + 2] grid hnuke_start - 1:hnuke_goal + 2 hnuke_start - 1 hnuke_start 1 hnuke_goal + 2 hnuke_goal 2 is_space_continuing = True is_space_continuing True if snuke_goal < hnuke_goal and not is_rock_continuing:
        print("Yes")
    elif hnuke_goal < snuke_goal and not is_rock_continuing and is_space_continuing:
        print("Yes")
    else:
        print("No") snuke_goal < hnuke_goal and not is_rock_continuing snuke_goal < hnuke_goal snuke_goal hnuke_goal not is_rock_continuing is_rock_continuing print("Yes") print "Yes" elif hnuke_goal < snuke_goal and not is_rock_continuing and is_space_continuing:
        print("Yes")
     hnuke_goal < snuke_goal and not is_rock_continuing and is_space_continuing hnuke_goal < snuke_goal and not is_rock_continuing hnuke_goal < snuke_goal hnuke_goal snuke_goal not is_rock_continuing is_rock_continuing is_space_continuing print("Yes") print "Yes" print("No") print "No" if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    length, snuke_start, hnuke_start, snuke_goal, hnuke_goal = map(lambda x: int(x) - 1, input().split())
    grid = input()
    is_rock_continuing = False
    is_space_continuing = False
    if "##" in grid[min(snuke_start, hnuke_goal):max(snuke_goal, hnuke_goal) + 1]:
        is_rock_continuing = True
    if "..." in grid[hnuke_start - 1:hnuke_goal + 2]:
        is_space_continuing = True
    if snuke_goal < hnuke_goal and not is_rock_continuing:
        print("Yes")
    elif hnuke_goal < snuke_goal and not is_rock_continuing and is_space_continuing:
        print("Yes")
    else:
        print("No") def main():
    length, snuke_start, hnuke_start, snuke_goal, hnuke_goal = map(lambda x: int(x) - 1, input().split())
    grid = input()
    is_rock_continuing = False
    is_space_continuing = False
    if "##" in grid[min(snuke_start, hnuke_goal):max(snuke_goal, hnuke_goal) + 1]:
        is_rock_continuing = True
    if "..." in grid[hnuke_start - 1:hnuke_goal + 2]:
        is_space_continuing = True
    if snuke_goal < hnuke_goal and not is_rock_continuing:
        print("Yes")
    elif hnuke_goal < snuke_goal and not is_rock_continuing and is_space_continuing:
        print("Yes")
    else:
        print("No") main
def main():
    length, snuke_start, hnuke_start, snuke_goal, hnuke_goal = map(lambda x: int(x) - 1, input().split())
    grid = input()
    is_rock_continuing = False
    is_space_continuing = False
    if "##" in grid[min(snuke_start, hnuke_goal):max(snuke_goal, hnuke_goal) + 1]:
        is_rock_continuing = True
    if "..." in grid[hnuke_start - 1:hnuke_goal + 2]:
        is_space_continuing = True
    if snuke_goal < hnuke_goal and not is_rock_continuing:
        print("Yes")
    elif hnuke_goal < snuke_goal and not is_rock_continuing and is_space_continuing:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

