func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 1e3 + 5;   const int MOD = 1e9 + 7;   vector<int> g[N + N];   int mat[N][N], p[N + N], sub[N + N], vis[N + N];   int ans[N + N], instack[N + N], go = true, ct = 0;   vector<pair<int, int>> extime;   void putNumbers(int node) {     vis[node] = 1;     instack[node] = true;     ct++;     for (auto it : g[node]) {       if (!vis[it]) {         putNumbers(it);       } else if (instack[it])         go = false;     }     instack[node] = false;     extime.push_back({ct, node});     ct++;   }   void getAns(int node) {     vis[node] = 1;     ans[node] = max(ans[node], 1);     for (auto it : g[node])       if (!vis[it]) {         ans[it] = max(ans[it], ans[node] + 1);       }   }   int root(int u) {     while (p[u] != u) {       p[u] = p[p[u]];       u = p[u];     }     return u;   }   void merge(int uu, int vv) {     int u = root(uu), v = root(vv);     if (u == v) return;     if (sub[u] < sub[v]) swap(u, v);     p[v] = u;     sub[u] += sub[v];   }   int main() {     ios::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     int n, m, i, j;     cin >> n >> m;     for (i = 1; i <= n + m; i++) {       p[i] = i;       sub[i] = 1;     }     for (i = 1; i <= n; i++) {       string s;       cin >> s;       for (j = 0; j < m; j++) {         if (s[j] ==  < )           mat[i][j + 1] = -1;         else if (s[j] ==  = ) {           merge(i, n + j + 1);           mat[i][j + 1] = 0;         } else           mat[i][j + 1] = 1;       }     }     for (i = 1; i <= n; i++)       for (j = 1; j <= m; j++) {         int u = root(i), v = root(n + j);         if (mat[i][j] < 0) {           if (u == v) {             cout <<  No n ;             return 0;           }           g[u].push_back(v);         }         if (mat[i][j] > 0) {           if (u == v) {             cout <<  No n ;             return 0;           }           g[v].push_back(u);         }       }     for (i = 1; i <= n + m; i++)       if (!vis[i] && p[i] == i) {         putNumbers(i);         if (!go) {           cout <<  No n ;           return 0;         }       }     sort(extime.begin(), extime.end());     reverse(extime.begin(), extime.end());     memset(vis, 0, sizeof(vis));     for (auto it : extime)       if (!vis[it.second]) {         getAns(it.second);       }     cout <<  Yes n ;     for (i = 1; i <= n + m; i++) {       cout << ans[root(i)] <<    ;       if (i == n) cout <<   n ;     }     cout <<   n ;     return 0;   }   