#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define mm(a,b) memset(a,b,sizeof(a)) typedef long long ll; const long long mod = 1e9 + 7; const int maxn = 1000; const ll inf = 1e18; int n, k, in[maxn], m; int main() { int t, x, y, flag; cin >> t; while (t--) { mm(in, 0); scanf("%d%d%d", &n, &m, &k); while (m--) { scanf("%d%d", &x, &y); in[x]++, in[y]++; } flag = 1; for (int i = 1; i <= n; ++i) if (in[i] < k) { flag = 0; break; } if (flag) printf("Yes\n"); else printf("No\n"); } }