#include<stdio.h>
#include<algorithm>
using namespace std;
int n,a,b,c,d;
char s[1000000];
int main(){
	scanf("%d %d %d %d %d", &n,&a,&b,&c,&d);
	scanf("%s", &s);
	for(int i=min(a,b);i<=max(c,d);i++){
		if(s[i-1]=='#'&&s[i]=='#'){
			printf("No");
			return 0;
		}
	}
	if((a>b&&c<d)||(b>a&&d<c)){
		for(int i=max(a,b)-1;i<min(c,d);i++){
			if(s[i-1]=='.'&&s[i]=='.'&&s[i+1]=='.'){
				printf("Yes");
				return 0;
			}
		}
		printf("No");
	}else printf("Yes");
}
