简单题
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
#define maxn 10000
int k, m;
bool sel[maxn];
void input()
{
scanf("%d", &m);
memset(sel, 0, sizeof(sel));
for (int i = 0; i < k; i++)
{
int a;
scanf("%d", &a);
sel[a] = true;
}
bool ok = true;
for (int i = 0; i < m; i++)
{
int c, r;
scanf("%d%d", &c, &r);
int temp = 0;
for (int i = 0; i < c; i++)
{
int a;
scanf("%d", &a);
if (sel[a])
temp++;
}
if (temp < r)
ok = false;
}
if (ok)
printf("yes\n");
else
printf("no\n");
}
int main()
{
//freopen("t.txt", "r", stdin);
while (scanf("%d", &k), k)
{
input();
}
return 0;
}