#include using namespace std; using ll = long long; int main(){ int N, M, x, y; cin >> N >> M; vector>> E(N); vector color(N, -1); vector> bb, ww; vector b, w; string S; vector> a, c; for (int i=0; i> x >> S >> y; x--; y--; if (S == "<==>") a.push_back({x, y}); else c.push_back({x, y}); } cout << "No" << endl; return 0; //同じ for (auto [x, y] : a){ E[x].push_back({y, 1}); E[y].push_back({x, 1}); } for (auto [x, y] : c){ E[x].push_back({y, -1}); E[y].push_back({x, -1}); } auto dfs=[&](auto self, int from, int c)->void{ if (c == 1) b.push_back(from); else w.push_back(from); for (auto [to, tp] : E[from]){ if (color[to] != -1){ if (tp == 1 && color[to] != color[from]){ cout << "No" << endl; exit(0); } else if (tp == -1 && color[to] == color[from]){ cout << "No" << endl; exit(0); } else continue; } if (tp == 1) color[to] = c; else color[to] = 1-c; self(self, to, color[to]); } }; for (int i=0; i ans; for (int i=0; i ww[i].size()){ for (auto x : bb[i]) ans.push_back(x); } else{ for (auto x : ww[i]) ans.push_back(x); } } cout << "Yes" << endl; sort(ans.begin(), ans.end()); cout << ans.size() << endl; for (auto x : ans) cout << x+1 << " "; cout << endl; return 0; }