#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T, class U>
ostream &operator<<(ostream &o, const pair<T, U> &p) {
  o << "(" << p.first << "," << p.second << ")";
  return o;
}
template <class T>
ostream &operator<<(ostream &o, const vector<T> &v) {
  o << "[";
  for (T t : v) {
    o << t << ",";
  }
  o << "]";
  return o;
}
struct edge {
  int to;
  ll cap;
  int rev;
};
const int MAX_V = 110;
const ll F_INF = 12345678901234LL;
vector<edge> G[MAX_V];
int level[MAX_V];
int iter[MAX_V];
void add_edge(int from, int to, ll cap) {
  G[from].push_back({to, cap, (int)G[to].size()});
  G[to].push_back({from, 0, (int)G[from].size() - 1});
}
void dinic_bfs(int s) {
  memset(level, -1, sizeof(level));
  queue<int> que;
  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)) {
      edge &e = G[v][i];
      if (e.cap > 0 && level[e.to] < 0) {
        level[e.to] = level[v] + 1;
        que.push(e.to);
      }
    }
  }
}
ll dinic_dfs(int v, int t, ll f) {
  if (v == t) return f;
  for (int &i = iter[v]; i < G[v].size(); ++i) {
    edge &e = G[v][i];
    if (e.cap > 0 && level[v] < level[e.to]) {
      int d = dinic_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;
}
ll max_flow(int s, int t) {
  ll flow = 0;
  while (1) {
    dinic_bfs(s);
    if (level[t] < 0) return flow;
    memset(iter, 0, sizeof(iter));
    ll f;
    while ((f = dinic_dfs(s, t, F_INF)) > 0) flow += f;
  }
}
int main() {
  vector<string> days({"Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
                       "Saturday", "Sunday"});
  map<string, int> d;
  for (int(i) = 0; (i) < (int)(days.size()); ++(i)) d[days[i]] = i;
  int n;
  ll w;
  while (cin >> n >> w, n) {
    for (int(i) = 0; (i) < (int)(MAX_V); ++(i)) G[i].clear();
    int S = n + 7, T = S + 1;
    for (int(i) = 0; (i) < (int)(7); ++(i)) add_edge(S, i, w);
    ll sumt = 0;
    for (int(i) = 0; (i) < (int)(n); ++(i)) {
      ll t;
      int c;
      cin >> t >> c;
      sumt += t;
      add_edge(7 + i, T, t);
      while (c--) {
        string s;
        cin >> s;
        add_edge(d[s], 7 + i, w);
      }
    }
    cout << (max_flow(S, T) == sumt ? "Yes" : "No") << endl;
  }
  return 0;
}
