#include #include #include #include #include #include #include #include #include #include #define mkp make_pair #define mkt make_tuple #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define all(v) v.begin(), v.end() using namespace std; typedef long long ll; const ll MOD = 1e9 + 7; // const ll MOD = 998244353; template void chmin(T &a, const T &b) { if (a > b) a = b; } template void chmax(T &a, const T &b) { if (a < b) a = b; } void solve() { int M, D, K; cin >> M >> D >> K; vector cnt(10, 0); auto advance_day = [](int &M, int &D) -> void { if (M == 2 && D == 28) { M++; D = 1; } else if ((M == 4 || M == 6 || M == 9 || M == 11) && D == 30) { M++; D = 1; } else if ((M == 1 || M == 3 || M == 5 || M == 7 || M == 8 || M == 10 || M == 12) && D == 31) { M++; if (M == 13) M = 1; D = 1; } else { D++; } }; auto count = [&](int M, int D) -> void { cnt[M % 10]++; cnt[M / 10]++; cnt[D % 10]++; cnt[D / 10]++; }; rep(k, 7) { count(M, D); advance_day(M, D); } int type = 0; rep(i, 10) if (cnt[i] > 0) type++; if (type >= K) cout << "Yes" << endl; else cout << "No" << endl; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); solve(); return 0; }