Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

int main(){
    string S;
    cin >> S;
    vector<char> ch(4);
    for (int i = 0; i < 4;i++)
        ch[i] = S[i];

    sort(ch.begin(), ch.end());

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'string' was not declared in this scope
    7 |     string S;
      |     ^~~~~~
a.cc:7:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |     cin >> S;
      |     ^~~
      |     std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:12: error: 'S' was not declared in this scope
    8 |     cin >> S;
      |            ^
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<char> ch(4);
      |     ^~~~~~
a.cc:9:5: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:9:12: error: expected primary-expression before 'char'
    9 |     vector<char> ch(4);
      |            ^~~~
a.cc:11:9: error: 'ch' was not declared in this scope
   11 |         ch[i] = S[i];
      |         ^~
a.cc:13:10: error: 'ch' was not declared in this scope
   13 |     sort(ch.begin(), ch.end());
      |          ^~
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   13 |     sort(ch.begin(), ch.end());
      |     ^~~~
      |     std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:4:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:16:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |         cout << "Yes" << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |         cout << "Yes" << endl;
      |                          ^~~~
      |                          std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:18:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |         cout << "No" << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:18:25: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   18 |         cout << "No" << endl;
      |                         ^~~~
      |                         std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~