#include using namespace std; const int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int main() { int m, d, k; cin >> m >> d >> k; vector v(10); int nm = m; int nd = d; for(int i = 0; i < 7; i++) { if(nm <= 9) { v[0] = true; v[nm] = true; } else { v[1] = true; v[nm % 10] = true; } if(nd <= 9) { v[0] = true; v[nd] = true; } else { v[nd / 10] = true; v[nd % 10] = true; } nd++; if(month[nm] < nd) { nd = 1; nm++; if(nm == 13) nm = 1; } } int ans = 0; for(int i = 0; i < 10; i++) if(v[i]) ans++; if(k <= ans) cout << "Yes" << endl; else cout << "No" << endl; return 0; }