#!/usr/bin python3
# -*- coding: utf-8 -*-

def main():
    N, A, B, C, D = map(int, input().split())
    S = input()

    ret = 'No'
    if C<D:
        pathBtoD=S[B-1:D]
        pathAtoC=S[A-1:C]
        if pathBtoD.find('##')==-1 and pathAtoC.find('##')==-1:
            ret = 'Yes'
    else:
        pathBtoD=S[B-1:D]
        pathAtoC=S[A-1:C]
        pathBtoD2 = S[B-2:D+1]
        if pathBtoD.find('##')==-1 and pathAtoC.find('##')==-1:
            if pathBtoD2.find('...')!=-1:
                ret = 'Yes'
    print(ret)

if __name__ == '__main__':
    main() def main():
    N, A, B, C, D = map(int, input().split())
    S = input()

    ret = 'No'
    if C<D:
        pathBtoD=S[B-1:D]
        pathAtoC=S[A-1:C]
        if pathBtoD.find('##')==-1 and pathAtoC.find('##')==-1:
            ret = 'Yes'
    else:
        pathBtoD=S[B-1:D]
        pathAtoC=S[A-1:C]
        pathBtoD2 = S[B-2:D+1]
        if pathBtoD.find('##')==-1 and pathAtoC.find('##')==-1:
            if pathBtoD2.find('...')!=-1:
                ret = 'Yes'
    print(ret) 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 S = input() S input() input ret = 'No' ret 'No' if C<D:
        pathBtoD=S[B-1:D]
        pathAtoC=S[A-1:C]
        if pathBtoD.find('##')==-1 and pathAtoC.find('##')==-1:
            ret = 'Yes'
    else:
        pathBtoD=S[B-1:D]
        pathAtoC=S[A-1:C]
        pathBtoD2 = S[B-2:D+1]
        if pathBtoD.find('##')==-1 and pathAtoC.find('##')==-1:
            if pathBtoD2.find('...')!=-1:
                ret = 'Yes'
     C<D C D pathBtoD=S[B-1:D] pathBtoD S[B-1:D] S B-1:D B-1 B 1 D pathAtoC=S[A-1:C] pathAtoC S[A-1:C] S A-1:C A-1 A 1 C if pathBtoD.find('##')==-1 and pathAtoC.find('##')==-1:
            ret = 'Yes'
     pathBtoD.find('##')==-1 and pathAtoC.find('##')==-1 pathBtoD.find('##')==-1 pathBtoD.find('##') pathBtoD.find pathBtoD find '##' -1 pathAtoC.find('##')==-1 pathAtoC.find('##') pathAtoC.find pathAtoC find '##' -1 ret = 'Yes' ret 'Yes' pathBtoD=S[B-1:D] pathBtoD S[B-1:D] S B-1:D B-1 B 1 D pathAtoC=S[A-1:C] pathAtoC S[A-1:C] S A-1:C A-1 A 1 C pathBtoD2 = S[B-2:D+1] pathBtoD2 S[B-2:D+1] S B-2:D+1 B-2 B 2 D+1 D 1 if pathBtoD.find('##')==-1 and pathAtoC.find('##')==-1:
            if pathBtoD2.find('...')!=-1:
                ret = 'Yes'
     pathBtoD.find('##')==-1 and pathAtoC.find('##')==-1 pathBtoD.find('##')==-1 pathBtoD.find('##') pathBtoD.find pathBtoD find '##' -1 pathAtoC.find('##')==-1 pathAtoC.find('##') pathAtoC.find pathAtoC find '##' -1 if pathBtoD2.find('...')!=-1:
                ret = 'Yes'
     pathBtoD2.find('...')!=-1 pathBtoD2.find('...') pathBtoD2.find pathBtoD2 find '...' -1 ret = 'Yes' ret 'Yes' print(ret) print ret if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N, A, B, C, D = map(int, input().split())
    S = input()

    ret = 'No'
    if C<D:
        pathBtoD=S[B-1:D]
        pathAtoC=S[A-1:C]
        if pathBtoD.find('##')==-1 and pathAtoC.find('##')==-1:
            ret = 'Yes'
    else:
        pathBtoD=S[B-1:D]
        pathAtoC=S[A-1:C]
        pathBtoD2 = S[B-2:D+1]
        if pathBtoD.find('##')==-1 and pathAtoC.find('##')==-1:
            if pathBtoD2.find('...')!=-1:
                ret = 'Yes'
    print(ret) def main():
    N, A, B, C, D = map(int, input().split())
    S = input()

    ret = 'No'
    if C<D:
        pathBtoD=S[B-1:D]
        pathAtoC=S[A-1:C]
        if pathBtoD.find('##')==-1 and pathAtoC.find('##')==-1:
            ret = 'Yes'
    else:
        pathBtoD=S[B-1:D]
        pathAtoC=S[A-1:C]
        pathBtoD2 = S[B-2:D+1]
        if pathBtoD.find('##')==-1 and pathAtoC.find('##')==-1:
            if pathBtoD2.find('...')!=-1:
                ret = 'Yes'
    print(ret) main
#!/usr/bin python3
# -*- coding: utf-8 -*-

def main():
    N, A, B, C, D = map(int, input().split())
    S = input()

    ret = 'No'
    if C<D:
        pathBtoD=S[B-1:D]
        pathAtoC=S[A-1:C]
        if pathBtoD.find('##')==-1 and pathAtoC.find('##')==-1:
            ret = 'Yes'
    else:
        pathBtoD=S[B-1:D]
        pathAtoC=S[A-1:C]
        pathBtoD2 = S[B-2:D+1]
        if pathBtoD.find('##')==-1 and pathAtoC.find('##')==-1:
            if pathBtoD2.find('...')!=-1:
                ret = 'Yes'
    print(ret)

if __name__ == '__main__':
    main()