func_code_string: #include <bits/stdc++.h>   using namespace std;   const int inf = 1e9;   const long long INF = 1e18;   const int N = 100010;   struct E {     int to, nxt;   } e[N << 3];   vector<int> a[N];   int n, m, head[N], cnt, f[N], ans[N], t, g[N];   int Write[20];   int read() {     int d = 0, f = 1;     char c = getchar();     while (c <  0  || c >  9 ) {       if (c ==  - ) f = -1;       c = getchar();     }     while (c >=  0  && c <=  9 ) d = (d << 3) + (d << 1) + c - 48, c = getchar();     return d * f;   }   void write(int x) {     int t = 0;     if (x < 0) putchar( - ), x = -x;     for (; x; x /= 10) Write[++t] = x % 10;     if (!t) putchar( 0 );     for (int i = t; i >= 1; i--) putchar((char)(Write[i] + 48));   }   void judge() {     freopen( .in ,  r , stdin);     freopen( .out ,  w , stdout);   }   void work(int x, int y) {     if (!g[x])       g[x] = y;     else if (g[x] != y) {       puts( No );       exit(0);     }   }   void addedge(int x, int y) {     e[++cnt] = (E){y, head[x]};     head[x] = cnt;   }   void dfs(int u) {     for (int i = head[u]; i; i = e[i].nxt) {       int v = e[i].to;       if (g[v] == 1) {         puts( No );         exit(0);       }       if (g[v] == 0) g[v] = -1, dfs(v);     }   }   int main() {     n = read();     m = read();     for (int i = 1; i <= n; i++) {       int x = read();       for (int j = 1; j <= x; j++) a[i].push_back(read());     }     for (int i = n - 1; i; i--) {       int l = min(a[i].size(), a[i + 1].size());       bool bo = 0;       for (int j = 0; j < l; j++)         if (a[i][j] < a[i + 1][j]) {           bo = 1;           addedge(a[i + 1][j], a[i][j]);           break;         } else if (a[i][j] > a[i + 1][j]) {           bo = 1;           work(a[i][j], -1);           work(a[i + 1][j], 1);           break;         }       if (!bo && a[i].size() > a[i + 1].size()) {         puts( No );         return 0;       }     }     for (int i = 1; i <= m; i++)       if (g[i] == -1) dfs(i);     for (int i = 1; i <= m; i++)       if (g[i] == -1) ans[++t] = i;     puts( Yes );     printf( %d n , t);     for (int i = 1; i <= t; i++) write(ans[i]), putchar(   );     return 0;   }   