#include #include #include #include #include using namespace std; vector days{0,31,28,31,30,31,30,31,31,30,31,30,31}; map mp; void digitcount(int t){ mp[t%10]++; t/=10; mp[t%10]++; } int main(){ int m,d,k; cin >> m >> d >> k; digitcount(m); digitcount(d); for(int i = 0;i<6;i++){ d++; digitcount(d); if(days[m]==d) { d=1; digitcount(d); if(m==12) m = 1; else m++; digitcount(m); } } if(k<=mp.size()) cout << "Yes" << endl; else cout << "No" << endl; }