#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

constexpr double EPS = 1e-10;
//constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;
constexpr int MOD = 1'000'000'007;
//inline void modAdd(LL &l, LL &r) {l = (l + r) % MOD;}

template<class T> inline T sqr(T x) {return x*x;}

void solve() {
    int n,a,b,c,d;
    string s;
    cin >> n >> a >> b >> c >> d >> s;
    --a; --b; --c; --d;
    bool bo[2][200000] = {};
    bo[0][a] = true;
    bo[1][b] = true;
    REP(i,a,c) {
        if (bo[0][i] == false) {
            continue;
        }
        REP(j,1,3) {
            if (i + j >= n) break;
            if (s[i+j] != '#') bo[0][i+j] = true;
        }
    }
    REP(i,b,d) {
        if (bo[1][i] == false) {
            continue;
        }
        REP(j,1,3) {
            if (i + j >= n) break;
            if (s[i+j] != '#') bo[1][i+j] = true;
        }
    }
    if (bo[0][c] && bo[1][d]) {
        /*
        if ((a > b && c < d)) {
            if (bo[1][a-1] == false || bo[1][a+1] == false || bo[1][c-1] == false || bo[1][c+1] == false) {
                cout << "No" << endl;
            } else {
                cout << "Yes" << endl;
            }
        } else if ((a < b && c > d)) {
            if (bo[0][b-1] == false || bo[0][b+1] == false || bo[0][d-1] == false || bo[0][d+1] == false) {
                cout << "No" << endl;
            } else {
                cout << "Yes" << endl;
            }
        */
        if ((a > b && c < d) || (a < b && c > d)) {
            int l = max(a,b), r = min(c,d);
            REP(i,l,r+1) {
                if (s[i] == '#') continue;
                if ((bo[0][i-1] || bo[1][i-1]) && (bo[0][i+1] || bo[1][i+1])) {
                    /*
                    dump(i);
                    dump(bo[0][i-1]);
                    dump(bo[1][i-1]);
                    dump(bo[0][i+1]);
                    dump(bo[1][i+1]);
                    */
                    cout << "Yes" << endl;
                    return;
                }
            }
            cout << "No" << endl;
        } else {
            cout << "Yes" << endl;
        }
    }
    else cout << "No" << endl;
}

int main() {
    solve();
    
    return 0;
}

Measured memory_bytes: 900