#include <bits/stdc++.h>
using namespace std;
template <class T>
void debug(T begin, T end) {
  for (T i = begin; i != end; ++i) cout << *i << " ";
  cout << endl;
}
const long long INF = 1e12;
struct Edge {
  int to;
  long long cap;
  int rev;
  Edge() {}
  Edge(int t, long long c, int r) : to(t), cap(c), rev(r) {}
};
void add_edge(vector<vector<Edge> >& graph, int from, int to, long long cap) {
  graph[from].push_back(Edge(to, cap, graph[to].size()));
  graph[to].push_back(Edge(from, 0, graph[from].size() - 1));
}
map<string, int> idmake;
int getid(string s) {
  if (idmake.count(s)) return idmake[s];
  idmake[s] = idmake.size() - 1;
  return idmake[s];
}
bool used[1000];
long long dfs(vector<vector<Edge> >& graph, int v, int t, long long f) {
  if (v == t) return f;
  used[v] = true;
  for (int i = 0; i < (int)graph[v].size(); i++) {
    Edge& e = graph[v][i];
    if (!used[e.to] && e.cap > 0) {
      int d = dfs(graph, e.to, t, min(f, e.cap));
      if (d > 0) {
        e.cap -= d;
        graph[e.to][e.rev].cap += d;
        return d;
      }
    }
  }
  return 0;
}
long long max_flow(vector<vector<Edge> >& graph, int s, int e) {
  long long flow = 0;
  while (true) {
    memset(used, 0, sizeof(used));
    long long f = dfs(graph, s, e, INF);
    if (f == 0)
      return flow;
    else
      flow += f;
  }
}
int main() {
  long long N, week;
  while (cin >> N >> week, N || week) {
    vector<vector<Edge> > graph(N + 9);
    const int start = N + 7;
    const int end = N + 8;
    long long sumneed = 0;
    for (int i = (0); i < (int)7; ++i) {
      add_edge(graph, N + i, end, week);
    }
    for (int i = (0); i < (int)N; ++i) {
      long long need, c;
      cin >> need >> c;
      sumneed += need;
      add_edge(graph, start, i, need);
      while (c--) {
        string t;
        cin >> t;
        int id = getid(t);
        add_edge(graph, i, N + id, INF);
      }
    }
    long long flow = max_flow(graph, start, end);
    if (flow == sumneed)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
