#pragma GCC optimize("Ofast") #include using namespace std; typedef long long int ll; typedef unsigned long long int ull; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); ll myRand(ll B) { return (ull)rng() % B; } inline double time() { return static_cast(chrono::duration_cast(chrono::steady_clock::now().time_since_epoch()).count()) * 1e-9; } int month[] = {31,28,31,30,31,30,31,31,30,31,30,31}; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); set st; auto ins = [&](int m,int d) -> void { st.insert(m/10); st.insert(m%10); st.insert(d/10); st.insert(d%10); }; int m,d,k; cin >> m >> d >> k; for (int i = 0; i < 7; ++i) { ins(m,d); d++; if (month[m-1] < d) { d = 1; m++; if (m == 13) m = 1; } } if (st.size() >= k) { cout << "Yes" << endl; } else { cout << "No" << endl; } }