public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int k, m;

        while ((k = sc.nextInt())!=0 && k!=0) {
            m = sc.nextInt();
            HashMap course = new HashMap();
            boolean satisfied = true;
            for (int i = 0; i < k; i++) {
                course.put(sc.next(), 1);
            }
            for (int i = 0; i < m; i++) {
                int c = sc.nextInt();
                int r = sc.nextInt();
                int cnt = 0;
                for (int j = 0; j < c; j++) {
                    if (course.containsKey(sc.next())) {
                        cnt++;
                    }
                }

                if (cnt < r) {
                    satisfied = false;
                }
            }
            if (satisfied) {
                System.out.println("yes");
            } else {
                System.out.println("no");
            }
        }
    }