Language: C++

using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll n,a,b,c,d;
	cin>>n>>a>>b>>c>>d;
	a--;b--;c--;d--;
	string s;
	cin>>s;
	if(c<d){
		for(int i=b+1;i<=d;i++){
			if(s[i]=='#'&&s[i-1]=='#'){
				cout << "No"<<endl;
				return 0;
			}
		}
		if(b<a){
			bool ans=false;
			for(int i=b+2;i<=d;i++){
				if(s[i]=='.'&&s[i-1]=='.'&&s[i-2]=='.'){
					ans=true;
				}
			}
			if(ans==false){
				cout << "No"<<endl;
				return 0;
			}
		}
	}
	if(d<c){
		for(int i=a+1;i<=c;i++){
			if(s[i]=='#'&&s[i-1]=='#'){
				cout << "No"<<endl;
				return 0;
			}
		}
		if(a<b){
			bool ans=false;
			for(int i=a+2;i<=c;i++){
				if(s[i]=='.'&&s[i-1]=='.'&&s[i-2]=='.'){
					ans=true;
				}
			}
			if(ans==false){
				cout << "No"<<endl;
				return 0;
			}
		}
	}
	cout << "Yes";

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin>>n>>a>>b>>c>>d;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:10:9: error: 'string' was not declared in this scope
   10 |         string s;
      |         ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:11:14: error: 's' was not declared in this scope
   11 |         cin>>s;
      |              ^
a.cc:15:33: error: 'cout' was not declared in this scope
   15 |                                 cout << "No"<<endl;
      |                                 ^~~~
a.cc:15:33: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:47: error: 'endl' was not declared in this scope
   15 |                                 cout << "No"<<endl;
      |                                               ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:27:33: error: 'cout' was not declared in this scope
   27 |                                 cout << "No"<<endl;
      |                                 ^~~~
a.cc:27:33: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:47: error: 'endl' was not declared in this scope
   27 |                                 cout << "No"<<endl;
      |                                               ^~~~
a.cc:27:47: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:35:33: error: 'cout' was not declared in this scope
   35 |                                 cout << "No"<<endl;
      |                                 ^~~~
a.cc:35:33: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:35:47: error: 'endl' was not declared in this scope
   35 |                                 cout << "No"<<endl;
      |                                               ^~~~
a.cc:35:47: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:47:33: error: 'cout' was not declared in this scope
   47 |                                 cout << "No"<<endl;
      |                                 ^~~~
a.cc:47:33: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:47:47: error: 'endl' was not declared in this scope
   47 |                                 cout << "No"<<endl;
      |                                               ^~~~
a.cc:47:47: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:52:9: error: 'cout' was not declared in this scope
   52 |         cout << "Yes";
      |         ^~~~
a.cc:52:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'