#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds ;
#define ll long long
#define ld float
#define rep(i,a,b) for(ll i=a;i<b;i+=1)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define sz(a) int((a).size())
#define hell (ll)1000000007
#define f first
#define s second
#define sll(x) scanf("%lld",&x)
#define si(x) scanf("%d",&x)
typedef tree< ll , null_type , less<ll> , rb_tree_tag , tree_order_statistics_node_update > ordered_set ;
ll t = 1 ;
const ll N = 1e5 + 4 ;
vector<ll> fact(N,0) , invFac(N,0) ;
ll powMod( ll base , ll expo )
{
    ll ans = 1 ;
    while( expo > 0 ){
        if( expo & 1 ){

            ans = ( ans * base ) % hell ;
        }
        base = ( base * base ) % hell ;
        expo >>= 1 ;
    }
    return ans ;
}
ll add( ll x , ll y ){
    return ( x + y ) % hell ;
}
ll sub( ll x , ll y ){
    ll ans = x ;
    ans = ( x - y + hell ) % hell ;
    ans = ( ans + hell ) % hell ;
    return ans; 
}
ll mult( ll x , ll y ){
    ll ans = ( x * y ) % hell ;
    ans = ( ans + hell ) % hell ;
    return ans ;
}
ll inv( ll x ){
    return powMod( x , hell -2 ) ;
}
ll C( ll x , ll y )
{
    if( x < y || y < 0 )return 0 ;
    ll ans = mult( fact[x] , mult( invFac[y] , invFac[x-y] ) ) ;
    cout << "x :  " << x << " y : " << y << " C(x,y) : " << ans << "\n" ;
    return ans ;
}
void solve()
{
    string s ;
    ll n , a , b , c , d ;
    cin >> n >> a >> b >> c >> d ;
    cin >> s ;
    a--;
    c--;
    d--;
    b--;
    s[b]='B';
    vector<ll> va(n,0) , vb(n,0) ;
    va[a] = 1 ;
    vb[b] = 1 ;
    if( c < b )
    {
        rep( i , a + 1 , c + 1 ){
            va[i] = (ll) ( ( i > 0 ? va[i-1] : 0 ) || ( i > 1 ? va[i-2] : 0 ) ) ;
            if( s[i] != '.' )
                va[i] = 0 ;
        } 
        rep( i , b + 1 , d + 1 ){
            vb[i] = (ll) ( ( i > 0 ? vb[i-1] : 0 ) || ( i > 1 ? vb[i-2] : 0 ) ) ;
            if( s[i] != '.' )
                vb[i] = 0 ;
        }
        s[b] = '.' ;
    }
    else
    {
        if( c < d )
        {
            rep( i , b + 1 , d + 1 )
            {
                vb[i] = (ll) ( ( i > 0 ? vb[i-1] : 0 ) || ( i > 1 ? vb[i-2] : 0 ) ) ;
                if( s[i] != '.' )
                    vb[i] = 0 ;
            }
            s[b]='.';
            rep( i , a + 1 , c + 1 )
            {
                va[i] = (ll) ( ( i > 0 ? va[i-1] : 0 ) || ( i > 1 ? va[i-2] : 0 ) ) ;
                if( s[i] != '.' )
                    va[i] = 0 ;
            }
        }
        else
        {
            vector<ll> rb ;
            rb.pb(b);
            rep( i , b + 1 , d + 1 )
            {
                vb[i] = (ll) ( ( i > 0 ? vb[i-1] : 0 ) || ( i > 1 ? vb[i-2] : 0 ) ) ;
                if( s[i] != '.' )
                    vb[i] = 0 ;
                if( vb[i] and i < c )
                    rb.pb(i);
            }
            for( auto u : rb )
            {
                bool a1 = ( u > 0 ? (s[u-1] == '.' || s[u-1] == 'B') : true ) ;
                bool a2 = ( u < n ? (s[u+1] == '.' || s[u+1] == 'B') : true ) ;
                if( a1 == true and a2 == true ){
                    s[b] = '.' ;
                    //ff = true ;
                }
            }
            rep( i , a + 1 , c + 1 ){
                va[i] = (ll) ( ( i > 0 ? va[i-1] : 0 ) || ( i > 1 ? va[i-2] : 0 ) ) ;
                if( s[i] != '.' )
                    va[i] = 0 ;
            }
        }
    }
    /*rep( i , 0 , n )
		cout << va[i] << " " ;
	cout << "\n" ;
	rep( i , 0 , n )
		cout << vb[i] << " " ;
	cout << "\n" ;*/
    if( va[c] == 1 and vb[d] == 1 and s[b] == '.' )
        cout << "Yes" ;
    else
        cout << "No" ;
}
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    fact[0] = 1 ;
    rep( i , 1 , N )
        fact[i] = ( fact[i-1] * i ) % hell ;
    invFac[N-1] = inv(fact[N-1]) ;
    for( ll i = N - 2 ; i >= 0 ; i-- ){
        invFac[i] = ( invFac[i+1] * (i+1) ) % hell ;
    }
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    //cin>>t;
    while(t--)
        solve() ;
    return 0 ;
}


Measured memory_bytes: 5708