#include<iostream>
#include<vector>
#include <cmath>
#include<string>
#include <bitset>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)

using namespace std;

bool KenF(string &S, int &B);
bool KenS(string &S, int &A);

int main(){
    int N,A,B,C,D;
    string S;
    int flagF = 0;
    int flagS = 0;
    cin >> N >> A >> B >> C >> D;
    cin >> S;
    S[A-1]='S';
    S[B-1]='F';

    if(D>C){
        while(1){
            if(KenF(S,B)){
                if(B==D){
                    flagF = 1;
                    break;
                }
            }else{
                flagF = -1;
                break;
            }
        }
        if(flagF == -1){
            cout << "No" << endl;
            return 0;
        }
        while(1){
            if(KenS(S,A)){
                if(A==C){
                    flagS = 1;
                    break;
                }
            }else{
                flagS = -1;
                break;
            }
        }
        if(flagS == 1){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
        return 0;
    }
    else if(C > D){
        while(1){
            if(KenS(S,A)){
                if(A==C){
                    flagS = 1;
                    break;
                }else if(A > C){
                    flagS =-1;
                    break;
                }
            }else{
                if((S[A] == 'F' | S[A+1] == 'F') && (B!=D)){
                    if(KenF(S,B)){
                        if(B==D){
                            flagF = 1;
                        }
                        continue;
                    }else{
                        flagF = flagS = -1;
                        break;
                    }
                }
                flagS = -1;
                break;
            }
        }
        if(flagS==1){
            if(flagF==1){
                cout << "Yes" << endl;
                return 0;
            }else if(flagF == 0){
                while(1){
                    if(KenF(S,B)){
                        if(B==D){
                            flagF = 1;
                            break;
                        }else if(B > D){
                            cout << "No" << endl;
                            return 0;
                        }
                    }else{
                        flagF = -1;
                        break;
                    }
                }
                if(flagF==1){
                    cout << "Yes" << endl;
                    return 0;
                }
            }else{}
        }
        cout << "No" << endl;
        return 0;
    }
    else{
        cout << "error" <<endl;
    }
}

bool KenS(string &S, int &A){
    //cout << S << endl;
    if(S[A] == '.'){
        S[A-1]='.';
        S[A]='S';  
        A++;  
    }
    else if(S[A+1] == '.'){
        S[A-1]='.';
        S[A+1]='S';
        A = A+2;
    }else{
        return false;
    }
    return true;
}

bool KenF(string &S, int &B){
    //cout << S << endl;
    if(S[B] == '.'){
        S[B-1]='.';
        S[B]='F';
        B++;
    }
    else if(S[B+1] == '.'){
        S[B-1]='.';
        S[B+1]='F';
        B = B + 2;
    }else{
        return false;
    }
    return true;
}




Measured memory_bytes: 640