#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #define _GLIBCXX_DEBUG #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; inline string format(int m, int d) { string s = ""; if (m < 10) s += "0"; s += to_string(m); if (d < 10) s += "0"; s += to_string(d); return s; } int main() { int m, d, k; cin >> m >> d >> k; vector mon = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; set s; rep(_, 7) { for (char c : format(m, d)) s.insert(c); Debug(m, d, format(m, d), s); d++; if (d > mon[m]) d = 1, m++; } cout << (s.size() >= k ? "Yes" : "No") << endl; return 0; }