#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int N,M; cin >> N >> M; vector>> Graph(N); for(int i=0; i> u >> s >> v; u--; v--; if(s == "<==>"){ Graph.at(u).push_back({v,0}); Graph.at(v).push_back({u,0}); } else{ Graph.at(u).push_back({v,1}); Graph.at(v).push_back({u,1}); } } vector dist(N,-1); vector answer; for(int i=0; i through; queue Q; Q.push(i); dist.at(i) = 0; while(Q.size()){ int pos = Q.front(); Q.pop(); through.push_back(pos); int d = dist.at(pos); if(d == 0) zero++; else one++; for(auto [to,cost] : Graph.at(pos)){ int next = d^cost; if(dist.at(to) == -1){dist.at(to) = next; Q.push(to);} else if(dist.at(to) != next){cout << "No" << endl; return 0;} } } if(zero >= one){ for(auto v : through) if(dist.at(v) == 0) answer.push_back(v); } else{ for(auto v : through) if(dist.at(v) == 1) answer.push_back(v); } } sort(answer.begin(),answer.end()); if(answer.size() >= (N+1)/2){ cout << "Yes" << endl; cout << answer.size() << endl; for(int i=0; i