Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
const int inf=1e9;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
struct edge { int to, cap, rev; };//ikisaki youryou gyakuhen
#define MAX 200
vector<vector<edge> >G(MAX);//[MAX];
vector<bool>used(MAX);//[MAX];
void add_edge(ll from, ll to, ll cap){
	edge q={to,cap,ll(G[to].size())};
    G[from].push_back(q);
	q={from,0,ll(G[from].size()-1)};
    G[to].push_back(q);
}

ll dfs(ll v, ll t, ll f) {
    if(v == t) return f;
    used[v] = 1;
    for(int i = 0 ; i < G[v].size(); i++){
        edge &e = G[v][i];
        if(used[e.to] || e.cap <= 0) continue;
        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;
}
ll ford_fulkerson(ll s, ll t) {//from s to t
    ll flow = 0, f;
    while(1){
		used=vector<bool>(MAX,false);
        f = dfs(s, t, inf);
        if(f == 0) return flow;
        flow += f;
    }
}
int gcd(int a,int b){
	if(a<b)swap(a,b);
	if(b==0)return a;
	return gcd(b,a%b);
}
int main(){
	ll n,m;
	map<string,int>ma;
	ma["Sunday"]=0;
	ma["Monday"]=1;
	ma["Tuesday"]=2;
	ma["Wednesday"]=3;
	ma["Thursday"]=4;
	ma["Friday"]=5;
	ma["Saturday"]=6;
	while(cin>>n>>m,n+m){
		rep(i,MAX)G[i].clear();
		ll s=n+7,t=s+1;
		ll out=0;
		rep(i,n){
			ll c,d;
			cin>>c>>d;
			out+=c;
			add_edge(s,i,c);
			rep(j,d){
				string ss;
				cin>>ss;
				add_edge(i,n+ma[ss],m);
			}
		}
		rep(i,7)add_edge(n+i,t,m);
		if(ford_fulkerson(s,t)==out)cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
}

Compiler output:
a.cc: In function 'void add_edge(ll, ll, ll)':
a.cc:30:17: warning: narrowing conversion of 'to' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   30 |         edge q={to,cap,ll(G[to].size())};
      |                 ^~
a.cc:30:20: warning: narrowing conversion of 'cap' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   30 |         edge q={to,cap,ll(G[to].size())};
      |                    ^~~
a.cc:30:24: warning: narrowing conversion of '(ll)(& G.std::vector<std::vector<edge> >::operator[](((std::vector<std::vector<edge> >::size_type)to)))->std::vector<edge>::size()' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   30 |         edge q={to,cap,ll(G[to].size())};
      |                        ^~~~~~~~~~~~~~~~
a.cc:32:12: warning: narrowing conversion of 'from' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   32 |         q={from,0,ll(G[from].size()-1)};
      |            ^~~~
a.cc:32:19: warning: narrowing conversion of '(ll)((& G.std::vector<std::vector<edge> >::operator[](((std::vector<std::vector<edge> >::size_type)from)))->std::vector<edge>::size() - 1)' from 'll' {aka 'long long int'} to 'int' [-Wnarrowing]
   32 |         q={from,0,ll(G[from].size()-1)};
      |                   ^~~~~~~~~~~~~~~~~~~~
a.cc: In function 'll dfs(ll, ll, ll)':
a.cc:42:32: error: no matching function for call to 'min(ll&, int&)'
   42 |         ll d = dfs(e.to, t, min(f, e.cap));
      |                             ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:42:32: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   42 |         ll d = dfs(e.to, t, min(f, e.cap));
      |                             ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:42:32: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   42 |         ll d = dfs(e.to, t, min(f, e.cap));
      |                             ~~~^~~~~~~~~~