#include <set>
#include <map>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#define REP(i,n) for(int i=0; i<(int)(n); i++)

typedef long long ll;

using namespace std;

struct Edge{
  ll cap; // capacity
  int to;
  int rev; // reverse edge id

  Edge(){}
  Edge(ll c, int t, int r) :
    cap(c), to(t), rev(r){}
};

template<class E> // Edge type
class Graph{
public:
  typedef std::vector<std::vector<E> > G;

private:
  G g;

public:
  Graph(int n) : g(G(n)) {}

  void addEdge(int from, int to, ll cap){
    g[from].push_back(E(cap, to, g[to].size()));
    g[to].push_back(E(0, from, g[from].size() - 1));
  }

  G &getRowGraph(){
    return g;
  }
};

template<class E>
class Dinic{
  typedef typename Graph<E>::G G;
  G &g;
  std::size_t n; // size of graph

  std::vector<int> level;
  std::vector<int> iter;

  // other utilities

  // search length of shortest path from s
  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);
        }
      }
    }
  }

  // search path
  ll dfs(int v, int t, ll 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]){
        ll 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();
  }

  // Max flow of the flow from s to t.
  ll solve(int s, int t){
    ll flow = 0;
    while(true){
      ll 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>
ll 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;
    ll w;
    ll 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;

    REP(i, 7) g.addEdge(n + i, end, w);

    REP(i, n){
      long long t;
      int c;
      cin >> t >> c;
      all += t;
      g.addEdge(start, i, t);

      REP(j, c){
        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;
}