func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 2e2 + 10, oo = 1e9 + 10, MOD = 1e9 + 7;   int n, m;   char a[N][N];   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cin >> n >> m;     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) cin >> a[i][j];     }     if (n % 3 && m % 3) {       cout <<  NO n ;       return 0;     }     if (n % 3 == 0) {       int q = 0, r = 0, b = 0, g = 0;       for (int i = 1; i <= n; i++) {         for (int j = 2; j <= m; j++) {           if (a[i][j] != a[i][j - 1]) q = 1;         }         if (i <= n / 3) {           if (i > 1 && a[i][1] != a[i - 1][1]) q = 1;           continue;         }         if (i > n / 3 && i <= 2 * n / 3) {           if (i > n / 3 + 1 && a[i][1] != a[i - 1][1]) q = 1;           continue;         }         if (i > 2 * n / 3 + 1 && a[i][1] != a[i - 1][1]) q = 1;       }       if (a[1][1] ==  R ) r++;       if (a[n / 3 + 1][1] ==  R ) r++;       if (a[2 * n / 3 + 1][1] ==  R ) r++;       if (a[1][1] ==  G ) g++;       if (a[n / 3 + 1][1] ==  G ) g++;       if (a[2 * n / 3 + 1][1] ==  G ) g++;       if (a[1][1] ==  B ) b++;       if (a[n / 3 + 1][1] ==  B ) b++;       if (a[2 * n / 3 + 1][1] ==  B ) b++;       if (r == b && b == g && !q) {         cout <<  YES n ;         return 0;       }     }     if (m % 3 == 0) {       int q = 0, r = 0, b = 0, g = 0;       for (int j = 1; j <= m; j++) {         for (int i = 2; i <= n; i++) {           if (a[i][j] != a[i - 1][j]) q = 1;         }         if (j <= m / 3) {           if (j > 1 && a[1][j] != a[1][j - 1]) q = 1;           continue;         }         if (j > m / 3 && j <= 2 * m / 3) {           if (j > m / 3 + 1 && a[1][j] != a[1][j - 1]) q = 1;           continue;         }         if (j > 2 * m / 3 + 1 && a[1][j] != a[1][j - 1]) q = 1;       }       if (a[1][1] ==  R ) r++;       if (a[1][m / 3 + 1] ==  R ) r++;       if (a[1][2 * m / 3 + 1] ==  R ) r++;       if (a[1][1] ==  G ) g++;       if (a[1][m / 3 + 1] ==  G ) g++;       if (a[1][2 * m / 3 + 1] ==  G ) g++;       if (a[1][1] ==  B ) b++;       if (a[1][m / 3 + 1] ==  B ) b++;       if (a[1][2 * m / 3 + 1] ==  B ) b++;       if (r == b && b == g && !q) {         cout <<  YES n ;         return 0;       }     }     cout <<  NO n ;   }   