#include <bits/stdc++.h>
	#include <iomanip>      // std::setprecision
	using namespace std;
	#define what_is(x) cerr << #x << " is " << x << endl;
	#define bit(x,i) (x&(1<<i))  //select the bit of position i of x
	#define lowbit(x) ((x)&((x)^((x)-1))) //get the lowest bit of x
	#define hBit(msb,n) asm("bsrl %1,%0" : "=r"(msb) : "r"(n)) //get the highest bit of x, maybe the fastest
	#define IN(i,l,r) (l<i&&i<r) //the next for are for checking bound
	#define LINR(i,l,r) (l<=i&&i<=r)
	#define LIN(i,l,r) (l<=i&&i<r)
	#define INR(i,l,r) (l<i&&i<=r)
	#define F(i,L,R) for (int i = L; i < R; i++) //next four are for "for loops"
	#define FE(i,L,R) for (int i = L; i <= R; i++)
	#define FF(i,L,R) for (int i = L; i > R; i--)
	#define FFE(i,L,R) for (int i = L; i >= R; i--)
	#define char2Int(c) (c-'0')
	#define lastEle(vec) vec[vec.size()-1] 
	#define SZ(x) ((int)((x).size()))
	#define REMAX(a,b) (a)=max((a),(b)) // set a to the maximum of a and b
	#define REMIN(a,b) (a)=min((a),(b));
	#define FENWICK(k) (k&-k)
	#define FOREACH(i,t) for (auto i=t.begin(); i!=t.end(); i++) // traverse an STL data structure
	#define ALL(c) (c).begin(),(c).end() //handy for function like "sort()"
	#define PRESENT(c,x) ((c).find(x) != (c).end()) 
	#define CPRESENT(c,x) (find(ALL(c),x) != (c).end()) 
	#define LL long long //data types used often, but you don't want to type them time by time
	#define ull unsigned long long
	#define ui unsigned int
	#define us unsigned short
	#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
	#define INF 1001001001
	#define PI 3.1415926535897932384626
	//for map, pair
	#define mp make_pair
	#define fi first
	#define se second
	//for vectors
	#define pb push_back
	typedef int elem_t;
	typedef vector<int> vi; 
	typedef vector<vi> vvi; 
	typedef pair<int,int> ii; 
	// directions
	const int fx[4][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}};
	const int fxx[8][2] = {{0,1}, {0,-1}, {1,0}, {-1,0}, {1,1}, {1,-1}, {-1,1}, {-1,-1}};
	const int rogi[4][2] = { {1,1}, {1,-1}, {-1,1}, {-1,-1} };

	int n,a,b,c,d;
	string s;

	bool sega[222222], segb[222222];

	void finda(int acc) {
		if(sega[acc]) return;
		sega[acc] = true;
		if(acc+1 < n && s[acc+1] == '.') {
			finda(acc+1);
		} 
		if (acc + 2 < n && s[acc+2] == '.') {
			finda(acc+2);
		}
	}

	void findb(int acc) {
		if(segb[acc]) return;
		segb[acc] = true;
		
		if(acc+1 < n && s[acc+1] == '.') {
			findb(acc+1);
		} 
		if (acc + 2 < n && s[acc+2] == '.') {
			findb(acc+2);
		}
	}

	void dane() {
		cin>>n>>a>>b>>c>>d;
		cin>>s;
		a--;
		b--;
		c--;
		d--;
		
		//znajdz zasieg a
		finda(a);
		findb(b);
		// cout<<"A-\n";
		// F(i,0,n) {
		// 	cout<<sega[i];
		// }cout<<"\n";

		// cout<<"B-\n";
		// F(i,0,n) {
		// 	cout<<segb[i];
		// }cout<<"\n";

		if(c > d) {
			bool ans = false;
			//sprawdz czy da sie odwrocic
			F(i,0,n-1) {
				if(sega[i] && sega[i+1] && segb[i+1] && sega[i+2] && segb[i+2] && i+1<=d && i+2<=c) {
					ans = true;
				}
			}
			if(!ans) {
				cout<<"No\n";
				return;
			}
		}

		bool ans = sega[c] && segb[d];
		cout<<(ans?"Yes":"No")<<endl;

	}   


	int main() {
		IOS
		// int t;
		// cin>>t;
		// F(i,0,t)
			dane();
		return 0;
	}

Measured memory_bytes: 2768