#include<iostream>
#include <algorithm>
#include<string>
#include <bitset>
#include <vector>
#include <functional>
#include <climits>
#include <iomanip>
#include <utility>
#include <stack>
#include <queue>
#include <math.h>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <numeric>
#include <stack>
#include <map> // pair
#include <cstdlib>  // abs() for integer
#include <cmath>    // abs() for float, and fabs()
typedef std::stack<int> IntStack;
typedef std::stack<char> charStack;
#define START 0
#define FORWARD 1
#define BACK 2
using namespace std;
using ll = long long;
typedef pair <ll, ll > pll;
bool comp(const pll &a, const pll &b) {
	return a.first < b.first;
}
//*********************************************************
// 最大公約数（Greatest Common Divisor）を返す。
// 引数に０がある場合は０を返す。
//*********************************************************
ll gcd(ll a, ll b)
{
	ll tmp, r;
	if (a < b) {
		tmp = a;
		a = b;
		b = tmp;
	}

	/* ユークリッドの互除法 */
	r = a % b;
	while (r != 0) {
		a = b;
		b = r;
		r = a % b;
	}
	return b;
	//// 引数に０がある場合は０を返す
	//if ((0 == m) || (0 == n))
	//	return 0;

	//// ユークリッドの方法
	//while (m != n)
	//{
	//	if (m > n) m = m - n;
	//	else         n = n - m;
	//}
	//return m;
}//gcd
int main()
{
	ll a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, ans = 0;
	ll x[10004] = {};
	ll y[10004] = {};
	ll z[10004] = {};
	ll x2[10004] = {};
	//ll z2[10004][10004] = { {} };
	vector<tuple<ll, ll>> vec;
	string s;
	//IntStack yStack;
	//charStack Stack;
	//vector<pair<int, int> > pairs(a);
	//cout << LLONG_MAX<< endl;
	ll n;
	cin >> n;
	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;
	a--;
	b--;
	c--;
	d--;
	cin >> s;
	if (c < b)
	{
		for (int i = a; i < c; i++)
		{
			if (s[i] == '#'&&s[i + 1] == '#')
			{
				cout << "No" << endl;
				//cout << "1" << endl;
				return 0;
			}
		}
		for (int i = b; i < d; i++)
		{
			if (s[i] == '#'&&s[i + 1] == '#')
			{
				cout << "No" << endl;
				//cout << "1" << endl;
				return 0;
			}
		}
		cout << "Yes" << endl;

	}
	else
	{
		e = max(c, d);

		for (int i = min(a, b); i < e; i++)
		{
			if (s[i] == '#'&&s[i + 1] == '#')
			{
				cout << "No" << endl;
				//cout << "1" << endl;
				return 0;
			}
		}
		if (c < d)
		{
			cout << "Yes" << endl;
			//cout << "2" << endl;
			return 0;
		}
		e = min(c, d);
		for (int i = max(ll(0), max(a, b) - 1); i < d; i++)
		{
			if (s[i] == '.'&&s[i + 1] == '.'&&s[i + 2] == '.')
			{
				cout << "Yes" << endl;
				//cout << "3" << endl;
				return 0;
			}
		}
		cout << "No" << endl;
	}
	//cout << "4" << endl;




	//cout << (a-2)*180 << endl;

	////std::cout << std::fixed;
	//cout << std::setprecision(20) << << endl;
	//cout << d+1 << endl;
	//cout << "" << endl;

	return 0;
}
//sort(x, x + a, std::greater<ll>());

//char型の文字数字は、-'0'で数値に変換できる
//accumulate(x, x + a, 0);//int型までの配列の合計
//memcpy(x, visited, sizeof(ll)*n);
//void kansuu(ll num, ll visited[10]) {}
//kansuu(1, zz);
//cout << setprecision(15) << v << endl;
//cout << char(z - 'a');
//log10(i) + 1 //10進数の桁数を取得
//
//int temp;
//for (int i = 0; i < n - 1; i++) {
//	for (int j = n - 1; j > i; j--) {
//		if (w[j - 1] < w[j]) {  /* 前の要素の方が大きかったら */
//			temp = w[j];        /* 交換する */
//			w[j] = w[j - 1];
//			w[j - 1] = temp;
//		}
//	}
//}
//
//最小公倍数
//ll x = a * b;
//ll tmp;
///* 自然数 a > b を確認・入替 */
//if (a<b) {
//	tmp = a;
//	a = b;
//	b = tmp;
//}
///* ユークリッドの互除法 */
//ll r = a % b;
//while (r != 0) {
//	a = b;
//	b = r;
//	r = a % b;
//}
//a = x / b;//答え


/*vector<pair<ll, ll> > hoges(a);
for (int i = 0; i < a; i++)
{
cin >> x[i];
cin >> y[i];
hoges[i] = make_pair(x[i], y[i]);
}
sort(hoges.begin(),hoges.end(),comp);
for (int i = 0; i < a; i++)
{
if (hoges[i].second>=b)
{
ans += hoges[i].first*b;
break;
}
else
{
ans += hoges[i].first*hoges[i].second;
b -= hoges[i].second;

}
}*/

Measured memory_bytes: 640