Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  char M(4);
  cin >> M;
  if ( M[1] == M[2] && M[2] == M[3] && M[3] == M[1] ){
    cout << "Yes" << endl;
  }
  else if ( M[1] == M[2] && M[2] == M[4] && M[4] == M[1] ){
    cout << "Yes" << endl;
  }
  else if ( M[2] == M[3] && M[3] == M[4] && M[4] == M[2] ){
    cout << "Yes" << endl;
  }
  else if ( M[1] == M[3] && M[3] == M[4] && M[4] == M[1] ){
    cout << "Yes" << endl;
  }
  else if ( M[1] == M[2] && M[2] == M[3] && M[3] == M[4] && M[4] == M[1]){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: invalid types 'char[int]' for array subscript
    6 |   if ( M[1] == M[2] && M[2] == M[3] && M[3] == M[1] ){
      |         ^
a.cc:6:17: error: invalid types 'char[int]' for array subscript
    6 |   if ( M[1] == M[2] && M[2] == M[3] && M[3] == M[1] ){
      |                 ^
a.cc:6:25: error: invalid types 'char[int]' for array subscript
    6 |   if ( M[1] == M[2] && M[2] == M[3] && M[3] == M[1] ){
      |                         ^
a.cc:6:33: error: invalid types 'char[int]' for array subscript
    6 |   if ( M[1] == M[2] && M[2] == M[3] && M[3] == M[1] ){
      |                                 ^
a.cc:6:41: error: invalid types 'char[int]' for array subscript
    6 |   if ( M[1] == M[2] && M[2] == M[3] && M[3] == M[1] ){
      |                                         ^
a.cc:6:49: error: invalid types 'char[int]' for array subscript
    6 |   if ( M[1] == M[2] && M[2] == M[3] && M[3] == M[1] ){
      |                                                 ^
a.cc:9:14: error: invalid types 'char[int]' for array subscript
    9 |   else if ( M[1] == M[2] && M[2] == M[4] && M[4] == M[1] ){
      |              ^
a.cc:9:22: error: invalid types 'char[int]' for array subscript
    9 |   else if ( M[1] == M[2] && M[2] == M[4] && M[4] == M[1] ){
      |                      ^
a.cc:9:30: error: invalid types 'char[int]' for array subscript
    9 |   else if ( M[1] == M[2] && M[2] == M[4] && M[4] == M[1] ){
      |                              ^
a.cc:9:38: error: invalid types 'char[int]' for array subscript
    9 |   else if ( M[1] == M[2] && M[2] == M[4] && M[4] == M[1] ){
      |                                      ^
a.cc:9:46: error: invalid types 'char[int]' for array subscript
    9 |   else if ( M[1] == M[2] && M[2] == M[4] && M[4] == M[1] ){
      |                                              ^
a.cc:9:54: error: invalid types 'char[int]' for array subscript
    9 |   else if ( M[1] == M[2] && M[2] == M[4] && M[4] == M[1] ){
      |                                                      ^
a.cc:12:14: error: invalid types 'char[int]' for array subscript
   12 |   else if ( M[2] == M[3] && M[3] == M[4] && M[4] == M[2] ){
      |              ^
a.cc:12:22: error: invalid types 'char[int]' for array subscript
   12 |   else if ( M[2] == M[3] && M[3] == M[4] && M[4] == M[2] ){
      |                      ^
a.cc:12:30: error: invalid types 'char[int]' for array subscript
   12 |   else if ( M[2] == M[3] && M[3] == M[4] && M[4] == M[2] ){
      |                              ^
a.cc:12:38: error: invalid types 'char[int]' for array subscript
   12 |   else if ( M[2] == M[3] && M[3] == M[4] && M[4] == M[2] ){
      |                                      ^
a.cc:12:46: error: invalid types 'char[int]' for array subscript
   12 |   else if ( M[2] == M[3] && M[3] == M[4] && M[4] == M[2] ){
      |                                              ^
a.cc:12:54: error: invalid types 'char[int]' for array subscript
   12 |   else if ( M[2] == M[3] && M[3] == M[4] && M[4] == M[2] ){
      |                                                      ^
a.cc:15:14: error: invalid types 'char[int]' for array subscript
   15 |   else if ( M[1] == M[3] && M[3] == M[4] && M[4] == M[1] ){
      |              ^
a.cc:15:22: error: invalid types 'char[int]' for array subscript
   15 |   else if ( M[1] == M[3] && M[3] == M[4] && M[4] == M[1] ){
      |                      ^
a.cc:15:30: error: invalid types 'char[int]' for array subscript
   15 |   else if ( M[1] == M[3] && M[3] == M[4] && M[4] == M[1] ){
      |                              ^
a.cc:15:38: error: invalid types 'char[int]' for array subscript
   15 |   else if ( M[1] == M[3] && M[3] == M[4] && M[4] == M[1] ){
      |                                      ^
a.cc:15:46: error: invalid types 'char[int]' for array subscript
   15 |   else if ( M[1] == M[3] && M[3] == M[4] && M[4] == M[1] ){
      |                                              ^
a.cc:15:54: error: invalid types 'char[int]' for array subscript
   15 |   else if ( M[1] == M[3] && M[3] == M[4] && M[4] == M[1] ){
      |                                                      ^
a.cc:18:14: error: invalid types 'char[int]' for array subscript
   18 |   else if ( M[1] == M[2] && M[2] == M[3] && M[3] == M[4] && M[4] == M[1]){
      |              ^
a.cc:18:22: error: invalid types 'char[int]' for array subscript
   18 |   else if ( M[1] == M[2] && M[2] == M[3] && M[3] == M[4] && M[4] == M[1]){
      |                      ^
a.cc:18:30: error: invalid types 'char[int]' for array subscript
   18 |   else if ( M[1] == M[2] && M[2] == M[3] && M[3] == M[4] && M[4] == M[1]){
      |                              ^
a.cc:18:38: error: invalid types 'char[int]' for array subscript
   18 |   else if ( M[1] == M[2] && M[2] == M[3] && M[3] == M[4] && M[4] == M[1]){
      |                                      ^
a.cc:18:46: error: invalid types 'char[int]' for array subscript
   18 |   else if ( M[1] == M[2] && M[2] == M[3] && M[3] == M[4] && M[4] == M[1]){
      |                                              ^
a.cc:18:54: error: invalid types 'char[int]' for array subscript
   18 |   else if ( M[1] == M[2] && M[2] == M[3] && M[3] == M[4] && M[4] == M[1]){
      |                                                      ^
a.cc:18:62: error: invalid types 'char[int]' for array subscript
   18 |   else if ( M[1] == M[2] && M[2] == M[3] && M[3] == M[4] && M[4] == M[1]){
      |                                                              ^
a.cc:18:70: error: invalid types 'char[int]' for array subscript
   18 |   else if ( M[1] == M[2] && M[2] == M[3] && M[3] == M[4] && M[4] == M[1]){
      |                                                                      ^