//  Created by conan1024hao in 2019.
//  Copyright © 2019 conan1024hao. All rights reserved.
//  専用ライブラリです、自由にコピーして構いません。
//  感谢看我的代码！Wechat:conan1024hao QQ:810396815
#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define INF 10e16
#define MOD 1000000007
#define rep(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
typedef long long int ll;
typedef pair<ll,ll>P;
long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; }
long long LCM(long long a, long long b)  {return a/GCD(a,b)*b;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
ll cmp(pair<ll,string>a,pair<ll,string> b){
        if(a.fi!=b.fi)
        return a.fi<b.fi;
        else
        return a.se<b.se;
}

//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
int main(){//問題をちゃんと見ろ!!!!!!!!!!!!!!!!!      llか??????????
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------
    int n,a,b,c,d;cin>>n>>a>>b>>c>>d;
    a--;b--;c--;d--;
    string s;cin>>s;
    if(c<d){
    int cntdp=0;
    while(1){
        cntdp=0;
        if(b+2!=a&&s[b+2]!='#'&&b+2<=d){
            b+=2;cntdp++;
        }
        else if(b+1!=a&&s[b+1]!='#'&&b+1<=d){
            b++;cntdp++;
        }
        if(b==d||cntdp==0)
            break;
    }
    while(1){
        cntdp=0;
        if(a+2!=b&&s[a+2]!='#'&&a+2<=c){
            a+=2;cntdp++;
        }
        else if(a+1!=b&&s[a+1]!='#'&&a+1<=c){
            a++;cntdp++;
        }
        if(a==c||cntdp==0)
            break;
    }
    if(a==c&&b==d)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
    }
    else if(c>d){
        int cnt=0;
        while(1){
            if(s[b-1]=='.'&&s[b+1]=='.'&&cnt==0){
                cnt++;
                while(1){
                    int cntdp1=0;
                    if(a+2!=b&&s[a+2]!='#'&&a+2<=c){
                        a+=2;cntdp1++;
                    }
                    else if(a+1!=b&&s[a+1]!='#'&&a+1<=c){
                        a++;cntdp1++;
                    }
                    if(a==c||cntdp1==0)
                        break;
                }
            }
            int cntdp2=0;
            if(b+1!=a&&s[b+1]!='#'&&b+1<=d){
                b++;cntdp2++;
            }
            else if(b+2!=a&&s[b+2]!='#'&&b+2<=d){
                b+=2;cntdp2++;
            }
            
            if(b==d||cntdp2==0){
                if(s[b-1]=='.'&&s[b+1]=='.'&&cnt==0){
                    cnt++;
                    while(1){
                        int cntdp1=0;
                        if(a+2!=b&&s[a+2]!='#'&&a+2<=c){
                            a+=2;cntdp1++;
                        }
                        else if(a+1!=b&&s[a+1]!='#'&&a+1<=c){
                            a++;cntdp1++;
                        }
                        if(a==c||cntdp1==0)
                            break;
                    }
                }
                 break;
            }
               
        }
        if(a==c&&b==d)
            cout<<"Yes"<<endl;
        else
            cout<<"No"<<endl;
    }
    //-------------------------------
    return 0;
}
//---------------------------------------------------------------------------




Measured memory_bytes: 592