#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #pragma warning(disable:4996) typedef long long ll; #define MIN(a, b) ((a)>(b)? (b): (a)) #define MAX(a, b) ((a)<(b)? (b): (a)) #define LINF 9223300000000000000 #define INF 2140000000 const long long MOD = 1000000007; //const long long MOD = 998244353; using namespace std; vector > > g; // to,edge vector vis,fin; bool dfs(int paredge, int curr) { assert(vis[curr]==0); vis[curr]=1; int siz=(int)g[curr].size(); int i; for(i=0; i ind(n); iota(ind.begin(), ind.end(), 0); shuffle(ind.begin(), ind.end(), mt); for(auto i:ind) { if(vis[i]) continue; bool ret=dfs(-1,i); if(ret){ printf("Yes\n"); return; } } printf("No\n"); return; } int main(int argc, char* argv[]) { solve(); return 0; }