#include<bits/stdc++.h>
using namespace std;

using ll = long long int;
using llu = unsigned long long int;
using ld = long double;
const long long int NUM = 1000000;
const long double PI = 2*acos(0.0);
const int INF = 1e9 + 10 ;
const long long int maximum = (-1*INF);
#define LCM(a,b)            (a / __gcd(a,b)) * b
#define GCD(a,b)            __gcd(a,b)
#define dist(x1,y1,x2,y2)   sqrtl((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1))
#define sqr(a)              ((a)*(a))
#define fast                ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
#define precision(a)        fixed<<setprecision(a)
#define endl                "\n"
#define pb                  push_back
#define bp                  pop_back
#define pf                  push_front
#define fp                  pop_front
#define mp                  make_pair
#define ff                  first
#define ss                  second
#define ub                  upper_bound
#define lb                  lower_bound
#define all(x)              x.begin(), x.end()
#define debug(x)            cout<<"debug "<<x<<"\n"
#define ms(a,b)             memset((a),(b),sizeof(a))
#define min3(a,b,c)         min(a,min(b,c))
#define max3(a,b,c)         max(a,max(b,c))
#define min4(a,b,c,d)       min(min(a,b),min(c,d))
#define max4(a,b,c,d)       max(max(a,b),max(c,d))
#define max5(a,b,c,d,e)     max(max3(a,b,c),max(d,e))
#define min5(a,b,c,d,e)     min(min3(a,b,c),min(d,e))
#define REP(i,b)            for(long long int i = 0; i < b; i++)
#define READ(f)             freopen("f", "r", stdin)
#define WRITE               freopen("out.txt", "w", stdout)

/*void sieve(ll n) {
    bool status[(n>>1)+1] = {false};
    ll inc, i;
    for(i = 3; i*i <= n; i += 2)
    {
        if(!status[i>>1])
        {
            inc = i<<1;
            for(ll j = i*i; j <= n; j += inc)
                status[j>>1] = true;
        }
    }
}*/

/*struct A {
    ll a;
    ll low;
    ll high;
};*/

/*bool compare(A x, A y)
{
    if(x.high == y.high) {
        if (x.low == y.low)
            return x.a <= y.a;
        return x.low > y.low;
    }
    return x.high > y.high;
}*/

/*ll logs(ll x)
{
    return 64 - __builtin_clzll(x) - 1;
}*/

//map<char, ll> m = { {'q', 9}, {'r', 5}, {'b', 3}, {'n', 3}, {'p', 1}, {'k', 0}, {'.', 0} };

//||

int main() {
    fast;
    ll n, a, b, c, d;
    cin >> n >> a >> b >> c >> d;
    string s;
    cin >> s;
    bool flag = false;
    if (a > b && c < d) {
        for (ll i = a - 1; i < c; i++) {
            if (s[i-1] == '.' && s[i+1] == '.' && s[i] != '#')
                flag = true;
        }
    } else  if (b > a && d < c) {
        for (ll i = b - 1; i < d; i++) {
            if (s[i-1] == '.' && s[i+1] == '.' && s[i] != '#')
                flag = true;
        }
    } else {
        for (ll i = b - 1; i < d - 1; i++) {
            if (s[i] == '#' && s[i+1] == '#') {
                cout << "No";
                return 0;
            }
        }
        for (ll i = a - 1; i < c - 1; i++) {
            if (s[i] == '#' && s[i+1] == '#') {
                cout << "No";
                return 0;
            }
        }
        cout << "Yes";
        return 0;
    }
    if (flag) {
        for (ll i = b - 1; i < d - 1; i++) {
            if (s[i] == '#' && s[i+1] == '#') {
                cout << "No";
                return 0;
            }
        }
        for (ll i = a - 1; i < c - 1; i++) {
            if (s[i] == '#' && s[i+1] == '#') {
                cout << "No";
                return 0;
            }
        }
        cout << "Yes";
        return 0;
    } else
        cout << "No";
    return 0;
}


Measured memory_bytes: 592