import copy
def main():
    n, a, b, c, d = map(int, input().split())
    step = list(input())

    sn = a - 1
    fn = b - 1

    sn_goal = False
    fn_goal = False
    jump = -1
    
    while True:
        if d < c:
            if (step[fn - 1] == ".") and (step[fn + 1] == "."):
                jump = copy.deepcopy(fn)

        if fn == d - 1:
            fn_goal = True
            break

        if step[fn + 1] == ".":
            fn += 1
        elif step[fn + 2] == ".":
            fn += 2
        else:
            break

    if d < c:
        if jump == -1:
            print("No")
            exit()

        step[jump] = "#"

    while True:
        if sn == c - 1:
            sn_goal = True
            break

        if step[sn + 1] == ".":
            sn += 1
        elif step[sn + 2] == ".":
            sn += 2
        else:
            break
    
    if sn_goal and fn_goal:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main() import copy copy def main():
    n, a, b, c, d = map(int, input().split())
    step = list(input())

    sn = a - 1
    fn = b - 1

    sn_goal = False
    fn_goal = False
    jump = -1
    
    while True:
        if d < c:
            if (step[fn - 1] == ".") and (step[fn + 1] == "."):
                jump = copy.deepcopy(fn)

        if fn == d - 1:
            fn_goal = True
            break

        if step[fn + 1] == ".":
            fn += 1
        elif step[fn + 2] == ".":
            fn += 2
        else:
            break

    if d < c:
        if jump == -1:
            print("No")
            exit()

        step[jump] = "#"

    while True:
        if sn == c - 1:
            sn_goal = True
            break

        if step[sn + 1] == ".":
            sn += 1
        elif step[sn + 2] == ".":
            sn += 2
        else:
            break
    
    if sn_goal and fn_goal:
        print("Yes")
    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 step = list(input()) step list(input()) list input() input sn = a - 1 sn a - 1 a 1 fn = b - 1 fn b - 1 b 1 sn_goal = False sn_goal False fn_goal = False fn_goal False jump = -1 jump -1 while True:
        if d < c:
            if (step[fn - 1] == ".") and (step[fn + 1] == "."):
                jump = copy.deepcopy(fn)

        if fn == d - 1:
            fn_goal = True
            break

        if step[fn + 1] == ".":
            fn += 1
        elif step[fn + 2] == ".":
            fn += 2
        else:
            break

     True if d < c:
            if (step[fn - 1] == ".") and (step[fn + 1] == "."):
                jump = copy.deepcopy(fn)

         d < c d c if (step[fn - 1] == ".") and (step[fn + 1] == "."):
                jump = copy.deepcopy(fn)

         (step[fn - 1] == ".") and (step[fn + 1] == ".") step[fn - 1] == "." step[fn - 1] step fn - 1 fn 1 "." step[fn + 1] == "." step[fn + 1] step fn + 1 fn 1 "." jump = copy.deepcopy(fn) jump copy.deepcopy(fn) copy.deepcopy copy deepcopy fn if fn == d - 1:
            fn_goal = True
            break

         fn == d - 1 fn d - 1 d 1 fn_goal = True fn_goal True break if step[fn + 1] == ".":
            fn += 1
        elif step[fn + 2] == ".":
            fn += 2
        else:
            break

     step[fn + 1] == "." step[fn + 1] step fn + 1 fn 1 "." fn += 1 fn 1 elif step[fn + 2] == ".":
            fn += 2
         step[fn + 2] == "." step[fn + 2] step fn + 2 fn 2 "." fn += 2 fn 2 break if d < c:
        if jump == -1:
            print("No")
            exit()

        step[jump] = "#"

     d < c d c if jump == -1:
            print("No")
            exit()

         jump == -1 jump -1 print("No") print "No" exit() exit step[jump] = "#" step[jump] step jump "#" while True:
        if sn == c - 1:
            sn_goal = True
            break

        if step[sn + 1] == ".":
            sn += 1
        elif step[sn + 2] == ".":
            sn += 2
        else:
            break
    
     True if sn == c - 1:
            sn_goal = True
            break

         sn == c - 1 sn c - 1 c 1 sn_goal = True sn_goal True break if step[sn + 1] == ".":
            sn += 1
        elif step[sn + 2] == ".":
            sn += 2
        else:
            break
    
     step[sn + 1] == "." step[sn + 1] step sn + 1 sn 1 "." sn += 1 sn 1 elif step[sn + 2] == ".":
            sn += 2
         step[sn + 2] == "." step[sn + 2] step sn + 2 sn 2 "." sn += 2 sn 2 break if sn_goal and fn_goal:
        print("Yes")
    else:
        print("No") sn_goal and fn_goal sn_goal fn_goal print("Yes") print "Yes" 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())
    step = list(input())

    sn = a - 1
    fn = b - 1

    sn_goal = False
    fn_goal = False
    jump = -1
    
    while True:
        if d < c:
            if (step[fn - 1] == ".") and (step[fn + 1] == "."):
                jump = copy.deepcopy(fn)

        if fn == d - 1:
            fn_goal = True
            break

        if step[fn + 1] == ".":
            fn += 1
        elif step[fn + 2] == ".":
            fn += 2
        else:
            break

    if d < c:
        if jump == -1:
            print("No")
            exit()

        step[jump] = "#"

    while True:
        if sn == c - 1:
            sn_goal = True
            break

        if step[sn + 1] == ".":
            sn += 1
        elif step[sn + 2] == ".":
            sn += 2
        else:
            break
    
    if sn_goal and fn_goal:
        print("Yes")
    else:
        print("No") def main():
    n, a, b, c, d = map(int, input().split())
    step = list(input())

    sn = a - 1
    fn = b - 1

    sn_goal = False
    fn_goal = False
    jump = -1
    
    while True:
        if d < c:
            if (step[fn - 1] == ".") and (step[fn + 1] == "."):
                jump = copy.deepcopy(fn)

        if fn == d - 1:
            fn_goal = True
            break

        if step[fn + 1] == ".":
            fn += 1
        elif step[fn + 2] == ".":
            fn += 2
        else:
            break

    if d < c:
        if jump == -1:
            print("No")
            exit()

        step[jump] = "#"

    while True:
        if sn == c - 1:
            sn_goal = True
            break

        if step[sn + 1] == ".":
            sn += 1
        elif step[sn + 2] == ".":
            sn += 2
        else:
            break
    
    if sn_goal and fn_goal:
        print("Yes")
    else:
        print("No") main
import copy
def main():
    n, a, b, c, d = map(int, input().split())
    step = list(input())

    sn = a - 1
    fn = b - 1

    sn_goal = False
    fn_goal = False
    jump = -1
    
    while True:
        if d < c:
            if (step[fn - 1] == ".") and (step[fn + 1] == "."):
                jump = copy.deepcopy(fn)

        if fn == d - 1:
            fn_goal = True
            break

        if step[fn + 1] == ".":
            fn += 1
        elif step[fn + 2] == ".":
            fn += 2
        else:
            break

    if d < c:
        if jump == -1:
            print("No")
            exit()

        step[jump] = "#"

    while True:
        if sn == c - 1:
            sn_goal = True
            break

        if step[sn + 1] == ".":
            sn += 1
        elif step[sn + 2] == ".":
            sn += 2
        else:
            break
    
    if sn_goal and fn_goal:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()