Language: C++

#include <vector>
#include <algorithm>
#include <functional>
#include <array>

using namespace std;


int main(void)
{
	string s;
	cin >> s;

	char a, b;
	int count_a;


	if (s[0] == s[1] && s[0] == s[2] && s[0] && s[3]) {
		cout << "No" << endl;
		return 0;
	}
	if ((s[0] == s[1]) && (s[2] == s[3])) {
		cout << "Yes" << endl;
		return 0;
	}
	else if((s[0] == s[2]) && (s[1] == s[3])) {
		cout << "Yes" << endl;
		return 0;
	} if ((s[0] == s[3]) && (s[1] == s[2])) {
		cout << "Yes" << endl;
		return 0;
	}
	
	cout << "No" << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'string' was not declared in this scope
   11 |         string s;
      |         ^~~~~~
a.cc:4:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    3 | #include <functional>
  +++ |+#include <string>
    4 | #include <array>
a.cc:12:9: error: 'cin' was not declared in this scope
   12 |         cin >> s;
      |         ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <functional>
  +++ |+#include <iostream>
    4 | #include <array>
a.cc:12:16: error: 's' was not declared in this scope
   12 |         cin >> s;
      |                ^
a.cc:19:17: error: 'cout' was not declared in this scope
   19 |                 cout << "No" << endl;
      |                 ^~~~
a.cc:19:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:33: error: 'endl' was not declared in this scope
   19 |                 cout << "No" << endl;
      |                                 ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include <functional>
  +++ |+#include <ostream>
    4 | #include <array>
a.cc:23:17: error: 'cout' was not declared in this scope
   23 |                 cout << "Yes" << endl;
      |                 ^~~~
a.cc:23:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:34: error: 'endl' was not declared in this scope
   23 |                 cout << "Yes" << endl;
      |                                  ^~~~
a.cc:23:34: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:27:17: error: 'cout' was not declared in this scope
   27 |                 cout << "Yes" << endl;
      |                 ^~~~
a.cc:27:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:34: error: 'endl' was not declared in this scope
   27 |                 cout << "Yes" << endl;
      |                                  ^~~~
a.cc:27:34: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:30:17: error: 'cout' was not declared in this scope
   30 |                 cout << "Yes" << endl;
      |                 ^~~~
a.cc:30:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:30:34: error: 'endl' was not declared in this scope
   30 |                 cout << "Yes" << endl;
      |                                  ^~~~
a.cc:30:34: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:34:9: error: 'cout' was not declared in this scope
   34 |         cout << "No" << endl;
      |         ^~~~
a.cc:34:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:25: error: 'endl' was not declared in this scope
   34 |         cout << "No" << endl;
      |                         ^~~~
a.cc:34:25: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'