#!/usr/bin/env python3

import sys



YES = "Yes"  # type: str

NO = "No"  # type: str



def solve(N: int, A: int, B: int, C: int, D: int, S: str): 

    if(S[A-1] == '#' or S[B-1] == '#' or  S[C-1] == '#' or S[D-1] == '#'):

        print(NO)

        sys.exit()



    if(S[A-1:C].count('##') == 0 and S[B-1:D].count('##') == 0):

        if(D < C):

            sf = (S[A-1:D+1].count('...'))

            if(sf == 0):

                print(NO)

            

            elif(sf == 1):

                tS = list(S)

                tS[B-1] = 'b'

                tS = ''.join(tS)

                if(tS[A-1:D+1].count('..b#') == 1):

                    print(NO)

                else:

                    print(YES)

            ######### あとはここだけ考える ####

            elif(sf >= 2):

                # print('Im here!')

                tS = list(S)

                tS[B-1] = 'b'

                tS = ''.join(tS)

                ptS = tS.rfind('..b#')

                if(ptS == -1):

                    print(YES)

                else:

                    if(tS[ptS+3:D+1].count('...') == 0):

                        # print(tS[ptS:D])

                        print(NO)

                    else:

                        # print(tS[ptS:D])

                        print(YES)

        else: # D > Cの場合

            print(YES)  

    else:

        print(NO)

    return





# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)

def main():

    def iterate_tokens():

        for line in sys.stdin:

            for word in line.split():

                yield word

    tokens = iterate_tokens()

    N = int(next(tokens))  # type: int

    A = int(next(tokens))  # type: int

    B = int(next(tokens))  # type: int

    C = int(next(tokens))  # type: int

    D = int(next(tokens))  # type: int

    S = next(tokens)  # type: str

    solve(N, A, B, C, D, S)



if __name__ == '__main__':

    main()

#!/usr/bin/env python3

import sys



YES = "Yes"  # type: str

NO = "No"  # type: str



def solve(N: int, A: int, B: int, C: int, D: int, S: str):



    if(S[A-1:C+1].count('##') > 0 or S[B-1:D+1].count('##')):

    # if(S[A:max(C,D)].count('##') > 1):

        print(NO)

        sys.exit()



    if(D < C):

        if(S[B-2:D+1].count('...') <= 0):

            print(NO)

            sys.exit()

        else:

            print(YES)

    else:

        print(YES)

    return





# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)

def main():

    def iterate_tokens():

        for line in sys.stdin:

            for word in line.split():

                yield word

    tokens = iterate_tokens()

    N = int(next(tokens))  # type: int

    A = int(next(tokens))  # type: int

    B = int(next(tokens))  # type: int

    C = int(next(tokens))  # type: int

    D = int(next(tokens))  # type: int

    S = next(tokens)  # type: str

    solve(N, A, B, C, D, S)



if __name__ == '__main__':

    main()

#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, A: int, B: int, C: int, D: int, S: str):
    if S[A - 1] == "#" or S[B - 1] == "#" or S[C - 1] == "#" or S[D - 1] == "#":
        print(NO)
        sys.exit()
    if S[A - 1 : C].count("##") == 0 and S[B - 1 : D].count("##") == 0:
        if D < C:
            sf = S[A - 1 : D + 1].count("...")
            if sf == 0:
                print(NO)
            elif sf == 1:
                tS = list(S)
                tS[B - 1] = "b"
                tS = "".join(tS)
                if tS[A - 1 : D + 1].count("..b#") == 1:
                    print(NO)
                else:
                    print(YES)
            ######### あとはここだけ考える ####
            elif sf >= 2:
                # print('Im here!')
                tS = list(S)
                tS[B - 1] = "b"
                tS = "".join(tS)
                ptS = tS.rfind("..b#")
                if ptS == -1:
                    print(YES)
                else:
                    if tS[ptS + 3 : D + 1].count("...") == 0:
                        # print(tS[ptS:D])
                        print(NO)
                    else:
                        # print(tS[ptS:D])
                        print(YES)
        else:  # D > Cの場合
            print(YES)
    else:
        print(NO)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, A, B, C, D, S)


if __name__ == "__main__":
    main()

#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, A: int, B: int, C: int, D: int, S: str):
    if S[A - 1 : C + 1].count("##") > 0 or S[B - 1 : D + 1].count("##"):
        # if(S[A:max(C,D)].count('##') > 1):
        print(NO)
        sys.exit()
    if D < C:
        if S[B - 2 : D + 1].count("...") <= 0:
            print(NO)
            sys.exit()
        else:
            print(YES)
    else:
        print(YES)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, A, B, C, D, S)


if __name__ == "__main__":
    main()

-    if S[A - 1] == "#" or S[B - 1] == "#" or S[C - 1] == "#" or S[D - 1] == "#": +    if S[A - 1 : C + 1].count("##") > 0 or S[B - 1 : D + 1].count("##"): +        # if(S[A:max(C,D)].count('##') > 1): -    if S[A - 1 : C].count("##") == 0 and S[B - 1 : D].count("##") == 0: -        if D < C: -            sf = S[A - 1 : D + 1].count("...") -            if sf == 0: -                print(NO) -            elif sf == 1: -                tS = list(S) -                tS[B - 1] = "b" -                tS = "".join(tS) -                if tS[A - 1 : D + 1].count("..b#") == 1: -                    print(NO) -                else: -                    print(YES) -            ######### あとはここだけ考える #### -            elif sf >= 2: -                # print('Im here!') -                tS = list(S) -                tS[B - 1] = "b" -                tS = "".join(tS) -                ptS = tS.rfind("..b#") -                if ptS == -1: -                    print(YES) -                else: -                    if tS[ptS + 3 : D + 1].count("...") == 0: -                        # print(tS[ptS:D]) -                        print(NO) -                    else: -                        # print(tS[ptS:D]) -                        print(YES) -        else:  # D > Cの場合 +    if D < C: +        if S[B - 2 : D + 1].count("...") <= 0: +            print(NO) +            sys.exit() +        else: -        print(NO) +        print(YES)