Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define int long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
#define forn(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<(n);i++)
const int MOD = 1e9 + 7 ;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
const int N=300002;
 
int32_t main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      int n,a,b,c,d;
      cin>>n>>a>>b>>c>>d;
      a--; b--; c--; d--;
      string s;
      cin>>s;
      for(int i=a;i<=c;i++)
      {
            if(s[i]=='#')
            {
                  if(i!=0)
                  {
                        if(s[i-1]=='#')
                        {
                              cout<<"No\n";
                              return 0;
                        }
                  }
            }
      }
      for(int i=b;i<=d;i++)
      {
            if(s[i]=='#')
            {
                  if(i!=0)
                  {
                        if(s[i-1]=='#')
                        {
                              cout<<"No\n";
                              return 0;
                        }
                  }
            }
      }
      if(d<=c){
      for(int i=a;i<=c;i++)
      {
            if(s[i]=='.')
            {
                  if(i!=0)
                  {
                        if(s[i-1]=='.')
                        {
                              if(i+1<n)
                              {
                                    if(s[i+1]=='.')
                                    {
                                          cout<<"Yes\n";
                                          return 0;
                                    }
                              }
                        }
                  }
            }
      }
      }
      else{
            cout<<"Yes\n";
            return 0;
      }
      cout<<"No\n";
}     
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define int long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
#define forn(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<(n);i++)
const int MOD = 1e9 + 7 ;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
const int N=300002;

int32_t main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      int n,a,b,c,d;
      cin>>n>>a>>b>>c>>d;
      a--; b--; c--; d--;
      string s;
      cin>>s;
      for(int i=a;i<=c;i++)
      {
            if(s[i]=='#')
            {
                  if(i!=0)
                  {
                        if(s[i-1]=='#')
                        {
                              cout<<"No\n";
                              return 0;
                        }
                  }
            }
      }
      for(int i=b;i<=d;i++)
      {
            if(s[i]=='#')
            {
                  if(i!=0)
                  {
                        if(s[i-1]=='#')
                        {
                              cout<<"No\n";
                              return 0;
                        }
                  }
            }
      }
      if(d<=c){
      for(int i=b;i<=d;i++)
      {
            if(s[i]=='.')
            {
                  if(i!=0)
                  {
                        if(s[i-1]=='.')
                        {
                              if(i+1<n)
                              {
                                    if(s[i+1]=='.')
                                    {
                                          cout<<"Yes\n";
                                          return 0;
                                    }
                              }
                        }
                  }
            }
      }
      }
      else{
            cout<<"Yes\n";
            return 0;
      }
      cout<<"No\n";
}     


Compiler output:
a.cc:87:109: error: conflicting declaration 'typedef class __gnu_pbds::tree<std::pair<long long int, long long int>, __gnu_pbds::null_type, std::less<std::pair<long long int, long long int> >, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update> ordered_set'
   87 | typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
      |                                                                                                             ^~~~~~~~~~~
a.cc:5:109: note: previous declaration as 'typedef class __gnu_pbds::tree<std::pair<int, int>, __gnu_pbds::null_type, std::less<std::pair<int, int> >, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update> ordered_set'
    5 | typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
      |                                                                                                             ^~~~~~~~~~~
a.cc:97:11: error: redefinition of 'const long long int MOD'
   97 | const int MOD = 1e9 + 7 ;
      |           ^~~
a.cc:15:11: note: 'const long long int MOD' previously defined here
   15 | const int MOD = 1e9 + 7 ;
      |           ^~~
a.cc:98:5: error: redefinition of 'long long int mpow(long long int, long long int, long long int)'
   98 | int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
      |     ^~~~
a.cc:16:5: note: 'long long int mpow(long long int, long long int, long long int)' previously defined here
   16 | int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
      |     ^~~~
a.cc:99:11: error: redefinition of 'const long long int N'
   99 | const int N=300002;
      |           ^
a.cc:17:11: note: 'const long long int N' previously defined here
   17 | const int N=300002;
      |           ^
a.cc:101:9: error: redefinition of 'int32_t main()'
  101 | int32_t main(){
      |         ^~~~
a.cc:19:9: note: 'int32_t main()' previously defined here
   19 | int32_t main(){
      |         ^~~~