#include <bits/stdc++.h>
using namespace std;
const int INFTY = 1 << 29;
struct Edge {
  int src, dst, flow, capacity, next;
  Edge() {}
  Edge(int s, int d, int f, int c, int n)
      : src(s), dst(d), flow(f), capacity(c), next(n) {}
};
void AddEdge(vector<Edge>& es, vector<int>& head, int src, int dst, int flow,
             int capacity) {
  es.push_back(Edge(src, dst, flow, capacity, head[src]));
  head[src] = es.size() - 1;
}
vector<int> BFS(const vector<Edge>& es, const vector<int>& head, int begin) {
  int size = head.size();
  vector<int> label(size, size);
  queue<pair<int, int> > q;
  q.push(make_pair(begin, 0));
  while (q.size()) {
    pair<int, int> cur = q.front();
    q.pop();
    if (label[cur.first] <= cur.second) continue;
    label[cur.first] = cur.second;
    for (int i = head[cur.first]; i != -1; i = es[i].next)
      if (es[i].capacity - es[i].flow > 0)
        q.push(make_pair(es[i].dst, cur.second + 1));
  }
  return label;
}
int DFS(vector<Edge>& es, vector<int>& head, int v, int end,
        const vector<int>& label, int f) {
  if (v == end) return f;
  for (int& i = head[v]; i != -1; i = es[i].next) {
    Edge& e = es[i];
    if (label[e.src] >= label[e.dst]) continue;
    int residue = e.capacity - e.flow;
    if (residue <= 0) continue;
    int augment = DFS(es, head, e.dst, end, label, min(residue, f));
    if (augment > 0) {
      e.flow += augment;
      es[i ^ 1].flow -= augment;
      return augment;
    }
  }
  return 0;
}
int Dinic(vector<Edge>& es, const vector<int>& head, int begin, int end) {
  int size = head.size();
  for (;;) {
    vector<int> label = BFS(es, head, begin);
    if (label[end] == size) break;
    vector<int> temp = head;
    while (DFS(es, temp, begin, end, label, INFTY))
      ;
  }
  int res = 0;
  for (int i = head[begin]; i != -1; i = es[i].next) res += es[i].flow;
  return res;
}
int main() {
  string dow[] = {"Sunday",   "Monday", "Tuesday", "Wednesday",
                  "Thursday", "Friday", "Saturday"};
  map<string, int> dtoi;
  for (int i = int(0); i < int(7); i++) dtoi[dow[i]] = i;
  for (int n, w; scanf("%d%d", &n, &w), n | w;) {
    vector<Edge> es;
    vector<int> head(7 + n + 2, -1);
    int src = 7 + n, snk = src + 1;
    for (int i = int(0); i < int(7); i++) {
      AddEdge(es, head, src, i, 0, w);
      AddEdge(es, head, i, src, 0, 0);
    }
    int sum = 0;
    for (int i = int(0); i < int(n); i++) {
      int t, c;
      scanf("%d%d", &t, &c);
      sum += t;
      for (int j = int(0); j < int(c); j++) {
        char s[10];
        scanf("%s", s);
        int x = dtoi[s];
        AddEdge(es, head, x, 7 + i, 0, w);
        AddEdge(es, head, 7 + i, x, 0, 0);
      }
      AddEdge(es, head, 7 + i, snk, 0, t);
      AddEdge(es, head, snk, 7 + i, 0, 0);
    }
    if (Dinic(es, head, src, snk) == sum)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
