#include <bits/stdc++.h>
using namespace std;
struct Edge {
  long long cap;
  int to;
  int rev;
  Edge() {}
  Edge(long long c, int t, int r) : cap(c), to(t), rev(r) {}
};
template <class E>
class Graph {
 public:
 private:
  std::vector<std::vector<E> > g;

 public:
  Graph(int n) : g(std::vector<std::vector<E> >(n)) {}
  void addEdge(int from, int to, long long cap) {
    g[from].push_back(E(cap, to, g[to].size()));
    g[to].push_back(E(0, from, g[from].size() - 1));
  }
  std::vector<std::vector<E> > &getRowGraph() { return g; }
};
template <class E>
class Dinic {
  typename Graph<E>::G &g;
  std::size_t n;
  std::vector<int> level;
  std::vector<int> iter;
  void bfs(int s) {
    std::queue<int> que;
    level = std::vector<int>(n, -1);
    level[s] = 0;
    que.push(s);
    while (!que.empty()) {
      int v = que.front();
      que.pop();
      for (int i = 0; i < (int)g[v].size(); i++) {
        E &e = g[v][i];
        if (e.cap > 0 && level[e.to] < 0) {
          level[e.to] = level[v] + 1;
          que.push(e.to);
        }
      }
    }
  }
  long long dfs(int v, int t, long long f) {
    if (v == t) return f;
    for (int &i = iter[v]; i < (int)g[v].size(); i++) {
      E &e = g[v][i];
      if (e.cap > 0 && level[v] < level[e.to]) {
        long long d = dfs(e.to, t, min(f, e.cap));
        if (d > 0) {
          e.cap -= d;
          g[e.to][e.rev].cap += d;
          return d;
        }
      }
    }
    return 0;
  }

 public:
  Dinic(Graph<E> &graph) : g(graph.getRowGraph()) { n = g.size(); }
  int solve(int s, int t) {
    long long flow = 0;
    while (true) {
      long long f;
      bfs(s);
      if (level[t] < 0) return flow;
      iter = std::vector<int>(n, 0);
      while ((f = dfs(s, t, (1ll << 60))) > 0) {
        flow += f;
      }
    }
  }
};
template <class E>
long long dinic(Graph<E> &g, int s, int d) {
  return Dinic<E>(g).solve(s, d);
}
template <class T>
class IdMaker {
 public:
  std::map<T, int> _m;
  int getId(const T &v) {
    if (_m.find(v) == _m.end()) {
      int next = _m.size();
      return _m[v] = next;
    }
    return _m[v];
  }
};
int main() {
  while (true) {
    int n;
    long long w;
    long long all = 0;
    IdMaker<string> idm;
    cin >> n >> w;
    if (n + w == 0) break;
    Graph<Edge> g(n + 7 + 2);
    const int start = n + 7;
    const int end = n + 7 + 1;
    for (int i = 0; i < (int)(7); i++) g.addEdge(n + i, end, w);
    for (int i = 0; i < (int)(n); i++) {
      long long t;
      int c;
      cin >> t >> c;
      all += t;
      g.addEdge(start, i, t);
      for (int j = 0; j < (int)(c); j++) {
        string buff;
        cin >> buff;
        int m = idm.getId(buff);
        g.addEdge(i, n + m, w);
      }
    }
    all -= dinic(g, start, end);
    puts(all == 0 ? "Yes" : "No");
  }
  return 0;
}
