def main():
    #入力
    N, A, B, C, D = (int(_) for _ in input().split())
    A, B, C, D = A-1, B-1, C-1, D-1
    S = input()

    sa, sb = S[A:C+1], S[B:D+1]
    can1 = can2 = True
    for i in range(len(sa)-1):
        if sa[i] == '#' and sa[i+1] == '#': can1 = False
    for i in range(len(sb)-1):
        if sb[i] == '#' and sb[i+1] == '#': can2 = False
    can = can1 and can2

    if can and D < C:
        sc = S[B-1:D+2]
        can3 = False
        for i in range(len(sc)-2):
            if sc[i] == '.' and sc[i+1] == '.' and sc[i+2] == '.': can3 = True
        can = can and can3

    print('Yes' if can else 'No')
    return

if __name__ == '__main__':
    main() def main():
    #入力
    N, A, B, C, D = (int(_) for _ in input().split())
    A, B, C, D = A-1, B-1, C-1, D-1
    S = input()

    sa, sb = S[A:C+1], S[B:D+1]
    can1 = can2 = True
    for i in range(len(sa)-1):
        if sa[i] == '#' and sa[i+1] == '#': can1 = False
    for i in range(len(sb)-1):
        if sb[i] == '#' and sb[i+1] == '#': can2 = False
    can = can1 and can2

    if can and D < C:
        sc = S[B-1:D+2]
        can3 = False
        for i in range(len(sc)-2):
            if sc[i] == '.' and sc[i+1] == '.' and sc[i+2] == '.': can3 = True
        can = can and can3

    print('Yes' if can else 'No')
    return main int(_) for _ in input().split() for _ in input().split() _ input().split() ().split () input split for _ in input().split() int(_) int _ N, A, B, C, D = (int(_) for _ in input().split()) N (int(_) for _ in input().split()) A B C D A, B, C, D = A-1, B-1, C-1, D-1 A A-1 A 1 B B-1 B 1 C C-1 C 1 D D-1 D 1 S = input() S input() input sa, sb = S[A:C+1], S[B:D+1] sa S[A:C+1] S A:C+1 A C+1 C 1 sb S[B:D+1] S B:D+1 B D+1 D 1 can1 = can2 = True can1 True = can2 = True can2 True for i in range(len(sa)-1):
        if sa[i] == '#' and sa[i+1] == '#': can1 = False
     i range(len(sa)-1) range len(sa)-1 len(sa) len sa 1 if sa[i] == '#' and sa[i+1] == '#': can1 = False
     sa[i] == '#' and sa[i+1] == '#' sa[i] == '#' sa[i] sa i '#' sa[i+1] == '#' sa[i+1] sa i+1 i 1 '#' for i in range(len(sb)-1):
        if sb[i] == '#' and sb[i+1] == '#': can2 = False
     i range(len(sb)-1) range len(sb)-1 len(sb) len sb 1 if sb[i] == '#' and sb[i+1] == '#': can2 = False
     sb[i] == '#' and sb[i+1] == '#' sb[i] == '#' sb[i] sb i '#' sb[i+1] == '#' sb[i+1] sb i+1 i 1 '#' can = can1 and can2 can can1 and can2 can1 can2 if can and D < C:
        sc = S[B-1:D+2]
        can3 = False
        for i in range(len(sc)-2):
            if sc[i] == '.' and sc[i+1] == '.' and sc[i+2] == '.': can3 = True
        can = can and can3

     can and D < C can D < C D C sc = S[B-1:D+2] sc S[B-1:D+2] S B-1:D+2 B-1 B 1 D+2 D 2 can3 = False can3 False for i in range(len(sc)-2):
            if sc[i] == '.' and sc[i+1] == '.' and sc[i+2] == '.': can3 = True
         i range(len(sc)-2) range len(sc)-2 len(sc) len sc 2 if sc[i] == '.' and sc[i+1] == '.' and sc[i+2] == '.': can3 = True
         sc[i] == '.' and sc[i+1] == '.' and sc[i+2] == '.' sc[i] == '.' and sc[i+1] == '.' sc[i] == '.' sc[i] sc i '.' sc[i+1] == '.' sc[i+1] sc i+1 i 1 '.' sc[i+2] == '.' sc[i+2] sc i+2 i 2 '.' can = can and can3 can can and can3 can can3 print('Yes' if can else 'No') print 'Yes' if can else 'No' can 'Yes' 'No' return if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    #入力
    N, A, B, C, D = (int(_) for _ in input().split())
    A, B, C, D = A-1, B-1, C-1, D-1
    S = input()

    sa, sb = S[A:C+1], S[B:D+1]
    can1 = can2 = True
    for i in range(len(sa)-1):
        if sa[i] == '#' and sa[i+1] == '#': can1 = False
    for i in range(len(sb)-1):
        if sb[i] == '#' and sb[i+1] == '#': can2 = False
    can = can1 and can2

    if can and D < C:
        sc = S[B-1:D+2]
        can3 = False
        for i in range(len(sc)-2):
            if sc[i] == '.' and sc[i+1] == '.' and sc[i+2] == '.': can3 = True
        can = can and can3

    print('Yes' if can else 'No')
    return def main():
    #入力
    N, A, B, C, D = (int(_) for _ in input().split())
    A, B, C, D = A-1, B-1, C-1, D-1
    S = input()

    sa, sb = S[A:C+1], S[B:D+1]
    can1 = can2 = True
    for i in range(len(sa)-1):
        if sa[i] == '#' and sa[i+1] == '#': can1 = False
    for i in range(len(sb)-1):
        if sb[i] == '#' and sb[i+1] == '#': can2 = False
    can = can1 and can2

    if can and D < C:
        sc = S[B-1:D+2]
        can3 = False
        for i in range(len(sc)-2):
            if sc[i] == '.' and sc[i+1] == '.' and sc[i+2] == '.': can3 = True
        can = can and can3

    print('Yes' if can else 'No')
    return main
def main():
    #入力
    N, A, B, C, D = (int(_) for _ in input().split())
    A, B, C, D = A-1, B-1, C-1, D-1
    S = input()

    sa, sb = S[A:C+1], S[B:D+1]
    can1 = can2 = True
    for i in range(len(sa)-1):
        if sa[i] == '#' and sa[i+1] == '#': can1 = False
    for i in range(len(sb)-1):
        if sb[i] == '#' and sb[i+1] == '#': can2 = False
    can = can1 and can2

    if can and D < C:
        sc = S[B-1:D+2]
        can3 = False
        for i in range(len(sc)-2):
            if sc[i] == '.' and sc[i+1] == '.' and sc[i+2] == '.': can3 = True
        can = can and can3

    print('Yes' if can else 'No')
    return

if __name__ == '__main__':
    main()
