// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")

//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")

// -------------------</optimizations>--------------------
#include<bits/stdc++.h>
using namespace std;
#define int long long
//#define d long double
#define pii pair<int,int>
#define pb push_back
#define cases int tc;cin>>tc;while(tc--)
#define N 200003
#define M 1003
#define inf LLONG_MAX
#define Arena ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
//int mod=1e9+7;
//int mod=998244353;

signed main()
{
    Arena

    int n,a,b,c,d;
    cin>>n>>a>>b>>c>>d;
    string s;
    cin>>s;
    int i,j;

    if(c<d)
    {
        i=b-1;
        while(i<=d-2)
        {
            if(s[i+1]=='.')
                ++i;
            else if(s[i+2]=='.')
                i+=2;
            else
            {
                cout<<"No";
                return 0;
            }
        }
        if(i!=d-1)
        {
            cout<<"No";
            return 0;
        }
        i=a-1;
        while(i<=c-2)
        {
            if(s[i+1]=='.')
                ++i;
            else if(s[i+2]=='.')
                i+=2;
            else
            {
                cout<<"No";
                return 0;
            }
        }
        if(i!=c-1)
        {
            cout<<"No";
            return 0;
        }
        cout<<"Yes";
        return 0;
    }
    else
    {
        i=a-1;
        while(i<=b-4)
        {
            if(s[i+1]=='.')
                ++i;
            else if(s[i+2]=='.')
                i+=2;
            else
            {
                cout<<"No";
                return 0;
            }
        }
        if(b>=2 and s[b-2]=='.')
            i=b-2;
        else if(b>=3 and s[b-3]=='.')
            i=b-3;
        else
        {
            cout<<"No";
            return 0;
        }

        j=i;
        i=b-1;
        while(i<=d-2 and j<=c-2)
        {
            if(s[j+1]=='.' and (j+1)!=i)
            {
                ++j;
                continue;
            }
            else if(s[j+2]=='.' and (j+2)!=i)
            {
                j+=2;
                continue;
            }
            if(s[i+1]=='.')
                j=i,++i;
            else if(s[i+2]=='.')
                j=i,i+=2;
            else
            {
                cout<<"No";
                return 0;
            }
        }
        while(j<=c-2)
        {
            if(s[j+1]=='.' and (j+1)!=i)
                ++j;
            else if(s[j+2]=='.' and (j+2)!=i)
                j+=2;
            else
            {
                cout<<"No";
                return 0;
            }
        }
        if(j!=c-1)
        {
            cout<<"No";
            return 0;
        }
        while(i<=d-2)
        {
            if(s[i+1]=='.')
                ++i;
            else if(s[i+2]=='.')
                i+=2;
            else
            {
                cout<<"No";
                return 0;
            }
        }
        cout<<"Yes";
        return 0;
    }
    cout<<"Yes";
    return 0;



    return 0;
}


Measured memory_bytes: 592