N,A,B,C,D=map(int,input().split())
S=list(input())

if A<B<C<D:
    a=True
    for i in range(A-1,D-2):
        if S[i]==S[i+1]=="#":
            print("No")
            a=False
            break
    if a==True:
        print("Yes")
elif A<C<B<D:
    a=True
    for i in range(A-1,C-2):
        if S[i]==S[i+1]=="#":
            print("No")
            a=False
            break
    if a==True:
        for i in range(B-1,D-2):
            if S[i]==S[i+1]=="#":
                print("No")
                a=False
                break
    if a==True:
        print("Yes")
elif A<B<D<C:
    a=True
    for i in range(A-1,C-2):
        if S[i]==S[i+1]=="#":
            b=True
            a=False
            break
    if a==True:
        b=True
        for i in range(B-2,D-2+1):
            if S[i]==S[i+1]==S[i+2]:
                b=False
                break
    if b==False:
        print("Yes")
    elif b==True:
        print("No") 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=list(input()) S list(input()) list input() input if A<B<C<D:
    a=True
    for i in range(A-1,D-2):
        if S[i]==S[i+1]=="#":
            print("No")
            a=False
            break
    if a==True:
        print("Yes")
elif A<C<B<D:
    a=True
    for i in range(A-1,C-2):
        if S[i]==S[i+1]=="#":
            print("No")
            a=False
            break
    if a==True:
        for i in range(B-1,D-2):
            if S[i]==S[i+1]=="#":
                print("No")
                a=False
                break
    if a==True:
        print("Yes")
elif A<B<D<C:
    a=True
    for i in range(A-1,C-2):
        if S[i]==S[i+1]=="#":
            b=True
            a=False
            break
    if a==True:
        b=True
        for i in range(B-2,D-2+1):
            if S[i]==S[i+1]==S[i+2]:
                b=False
                break
    if b==False:
        print("Yes")
    elif b==True:
        print("No") A<B<C<D A<B<C A<B A B C D a=True a True for i in range(A-1,D-2):
        if S[i]==S[i+1]=="#":
            print("No")
            a=False
            break
     i range(A-1,D-2) range A-1 A 1 D-2 D 2 if S[i]==S[i+1]=="#":
            print("No")
            a=False
            break
     S[i]==S[i+1]=="#" S[i]==S[i+1] S[i] S i S[i+1] S i+1 i 1 "#" print("No") print "No" a=False a False break if a==True:
        print("Yes") a==True a True print("Yes") print "Yes" elif A<C<B<D:
    a=True
    for i in range(A-1,C-2):
        if S[i]==S[i+1]=="#":
            print("No")
            a=False
            break
    if a==True:
        for i in range(B-1,D-2):
            if S[i]==S[i+1]=="#":
                print("No")
                a=False
                break
    if a==True:
        print("Yes") A<C<B<D A<C<B A<C A C B D a=True a True for i in range(A-1,C-2):
        if S[i]==S[i+1]=="#":
            print("No")
            a=False
            break
     i range(A-1,C-2) range A-1 A 1 C-2 C 2 if S[i]==S[i+1]=="#":
            print("No")
            a=False
            break
     S[i]==S[i+1]=="#" S[i]==S[i+1] S[i] S i S[i+1] S i+1 i 1 "#" print("No") print "No" a=False a False break if a==True:
        for i in range(B-1,D-2):
            if S[i]==S[i+1]=="#":
                print("No")
                a=False
                break
     a==True a True for i in range(B-1,D-2):
            if S[i]==S[i+1]=="#":
                print("No")
                a=False
                break
     i range(B-1,D-2) range B-1 B 1 D-2 D 2 if S[i]==S[i+1]=="#":
                print("No")
                a=False
                break
     S[i]==S[i+1]=="#" S[i]==S[i+1] S[i] S i S[i+1] S i+1 i 1 "#" print("No") print "No" a=False a False break if a==True:
        print("Yes") a==True a True print("Yes") print "Yes" elif A<B<D<C:
    a=True
    for i in range(A-1,C-2):
        if S[i]==S[i+1]=="#":
            b=True
            a=False
            break
    if a==True:
        b=True
        for i in range(B-2,D-2+1):
            if S[i]==S[i+1]==S[i+2]:
                b=False
                break
    if b==False:
        print("Yes")
    elif b==True:
        print("No") A<B<D<C A<B<D A<B A B D C a=True a True for i in range(A-1,C-2):
        if S[i]==S[i+1]=="#":
            b=True
            a=False
            break
     i range(A-1,C-2) range A-1 A 1 C-2 C 2 if S[i]==S[i+1]=="#":
            b=True
            a=False
            break
     S[i]==S[i+1]=="#" S[i]==S[i+1] S[i] S i S[i+1] S i+1 i 1 "#" b=True b True a=False a False break if a==True:
        b=True
        for i in range(B-2,D-2+1):
            if S[i]==S[i+1]==S[i+2]:
                b=False
                break
     a==True a True b=True b True for i in range(B-2,D-2+1):
            if S[i]==S[i+1]==S[i+2]:
                b=False
                break
     i range(B-2,D-2+1) range B-2 B 2 D-2+1 D-2 D 2 1 if S[i]==S[i+1]==S[i+2]:
                b=False
                break
     S[i]==S[i+1]==S[i+2] S[i]==S[i+1] S[i] S i S[i+1] S i+1 i 1 S[i+2] S i+2 i 2 b=False b False break if b==False:
        print("Yes")
    elif b==True:
        print("No") b==False b False print("Yes") print "Yes" elif b==True:
        print("No") b==True b True print("No") print "No" C,D=map(int,input().split()) map(int,input().split()) C A,B,C,D=map(int,input().split()) map(int,input().split()) A S=list(input()) list(input()) S b=False False b a=False False a a=False False a a=True True a D=map(int,input().split()) map(int,input().split()) D N,A,B,C,D=map(int,input().split()) map(int,input().split()) N a=False False a a=False False a b=True True b a=True True a b=True True b B,C,D=map(int,input().split()) map(int,input().split()) B a=True True a
N,A,B,C,D=map(int,input().split())
S=list(input())

if A<B<C<D:
    a=True
    for i in range(A-1,D-2):
        if S[i]==S[i+1]=="#":
            print("No")
            a=False
            break
    if a==True:
        print("Yes")
elif A<C<B<D:
    a=True
    for i in range(A-1,C-2):
        if S[i]==S[i+1]=="#":
            print("No")
            a=False
            break
    if a==True:
        for i in range(B-1,D-2):
            if S[i]==S[i+1]=="#":
                print("No")
                a=False
                break
    if a==True:
        print("Yes")
elif A<B<D<C:
    a=True
    for i in range(A-1,C-2):
        if S[i]==S[i+1]=="#":
            b=True
            a=False
            break
    if a==True:
        b=True
        for i in range(B-2,D-2+1):
            if S[i]==S[i+1]==S[i+2]:
                b=False
                break
    if b==False:
        print("Yes")
    elif b==True:
        print("No")