#include using namespace std; using ll = long long; const ll INF = 1ll << 60; #define REP(i, n) for(ll i =0; i < ll(n); i++) template using V = vector; template bool chmax(A& a, B b) { return a bool chmin(A& a, B b) { return b> n >> m >> k; V> g(n); REP(i, m) { int u, v; cin >> u >> v; u--; v--; g[u].push_back(v); } V> seen(2, V(n)); stack> stk; seen[0][0] = 1; stk.emplace(0, 0); while(!stk.empty()) { auto [d, u] = stk.top(); stk.pop(); for(int v : g[u]) { if(seen[d^1][v]) continue; seen[d^1][v] = 1; stk.emplace(d^1, v); } } REP(i, 2) REP(j, n) { if(!seen[i][j]) { cout << "No\n"; return; } } cout << "Yes\n"; } int main() { cin.tie(0)->sync_with_stdio(0); testcase(); }