#include <bits/stdc++.h>

#ifdef DEBUG
#define PRINT(x)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#x<<" = "<<(x)<<endl;
#define PRINTA(a,first,last)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#a<<"["<<(first)<<", "<<(last)<<")"<<endl;\
    for (int i=(first);i<(last);++i){cout<<#a<<"["<<i<<"] = "<<(a)[i]<<endl;}
#define PRINTP(p)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#p<<" = ("<<(p.first)<<", "<<(p.second)<<")"<<endl;
#define PRINTI(a,i)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#a<<"["<<#i<<"] = "<<#a<<"["<<(i)<<"] = "<<(a)[i]<<endl;
#else
#define PRINT(x)
#define PRINTA(a,first,last)
#define PRINTP(p)
#define PRINTI(a,i)
#endif

#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);--i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define RREP(i,n) for (int i=(n)-1;i>=0;--i)
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007

using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

template <class T, class U> void amax(T& x, U y) {if (x < y) x = y;}
template <class T, class U> void amin(T& x, U y) {if (x > y) x = y;}

const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N, A, B, C, D;
    cin >> N >> A >> B >> C >> D;
    --A;
    --B;
    --C;
    --D;
    string S;
    cin >> S;

    vector<bool> dpA(N, false), dpB(N, false), dpC(N, false), dpD(N, false);
    dpA[A] = true;
    dpB[B] = true;
    dpC[C] = true;
    dpD[D] = true;
    
    FOR(i, A, N) {
        if (dpA[i]) {
            if (i + 1 < N && S[i + 1] == '.') {
                dpA[i + 1] = true;
            }
            if (i + 2 < N && S[i + 2] == '.') {
                dpA[i + 2] = true;
            }
        }
    }
    FOR(i, B, N) {
        if (dpB[i]) {
            if (i + 1 < N && S[i + 1] == '.') {
                dpB[i + 1] = true;
            }
            if (i + 2 < N && S[i + 2] == '.') {
                dpB[i + 2] = true;
            }
        }
    }
    /*
    RREP(i, N) {
        if (i + 1 < N && S[i + 1] == '.') {
            if (dpC[i + 1] == true) {
                dpC[i] = true;
            }
            if (dpD[i + 1] == true) {
                dpD[i] = true;
            }
        }
        if (i + 2 < N && S[i + 2] == '.') {
            if (dpC[i + 2] == true) {
                dpC[i] = true;
            }
            if (dpD[i + 2] == true) {
                dpD[i] = true;
            }
        }
    }
    */
    if (C < D) {
        if (dpA[C] && dpB[D]) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    } else {
        if (dpA[C] && dpB[D]) {
            bool flag = false;
            /*
            FOR(i, B - 1, D) {
                if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
                    flag = true;
                }
            }
            */

            REP(i, min(D, N - 2)) {
                if (dpA[i] == true && dpA[i + 2] == true && dpB[i + 1] == true) {
                    flag = true;
                    /*
                    if (i + 2 == C) {
                        flag = true;
                        break;
                    } else if (S[i + 3] == '.') {
                        flag = true;
                        break;
                    } else if (S[i + 3] == '#' && i + 4 < N && S[i + 4] == '.') {
                        flag = true;
                        break;
                    }
                    */
                }
            }
            if (flag) {
                cout << "Yes" << endl;
            } else {
                cout << "No" << endl;
            }
        } else {
            cout << "No" << endl;
        }
    }

    return 0;
}



Measured memory_bytes: 592