#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    int N;
    int A, B, C, D;
    int a, b;
    string S;
    char W = '#';
    char O = '.';

    void input() {
        cin >> N;
        cin >> A >> B >> C >> D;
        A--, B--, C--, D--;
        cin >> S;
        a = A;
        b = B;
        S[a] = W;
        S[b] = W;
    }

    bool Adon() {
        while (a < C) {
            if (a + 1 <= C && S[a + 1] == O) {
                S[a] = O;
                a++;
                S[a] = W;
            } else if (a + 2 <= C && S[a + 2] == O) {
                S[a] = O;
                a++;
                a++;
                S[a] = W;
            } else {
                return false;
            }
        }
        return true;
    }

    bool Bdon() {
        while (b < D) {
            if (b + 1 <= D && S[b + 1] == O) {
                S[b] = O;
                b++;
                S[b] = W;
            } else if (b + 2 <= D && S[b + 2] == O) {
                S[b] = O;
                b++;
                b++;
                S[b] = W;
            } else {
                return false;
            }
        }
        return true;
    }

    bool Bchou() {
        while (b < D) {
            if (b == 0 && b + 1 < S.size() && S[b + 1] == O) {
                return true;
            }
            if (b > 0 && b + 1 < S.size() && S[b - 1] == O && S[b + 1] == O) {
                return true;
            }
            if (b > 0 && b + 1 == S.size() && S[b - 1] == O) {
                return true;
            }

            if (b + 1 <= D && S[b + 1] == O) {
                S[b] = O;
                b++;
                S[b] = W;
            } else if (b + 2 <= D && S[b + 2] == O) {
                S[b] = O;
                b++;
                b++;
                S[b] = W;
            } else {
                return false;
            }
        }
        return true;
    }

    bool cmp(int a, int b, int c, int d) {
        return a < b && b < c && c < d;
    }

    void solve() {
        input();
        if (cmp(A, B, C, D)) {
            if (Bdon() && Adon()) {
                cout << "Yes" << endl;
            } else {
                cout << "No" << endl;
            }
            return;
        }

        if (cmp(A, C, B, D)) {
            if (Bdon() && Adon()) {
                cout << "Yes" << endl;
            } else {
                cout << "No" << endl;
            }
            return;
        }

        if (cmp(A, B, D, C)) {
            Bchou();
            if (Adon() && Bdon()) {
                cout << "Yes" << endl;
            } else {
                cout << "No" << endl;
            }
            return;
        }
    }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    Solve().solve();


    return 0;
}


Measured memory_bytes: 888