#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int main(){ vector a = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, cnt(10); int M, D, K, x, y; cin >> M >> D >> K; for (int i=0; i<7; i++){ x = M / 10; y = M % 10; cnt[x]++; cnt[y]++; x = D / 10; y = D % 10; cnt[x]++; cnt[y]++; D++; if (D > a[M]){ D = 1; M++; if (M == 13) M = 1; } } for (int i=0; i<=9; i++){ if (cnt[i]) K--; } cout << (K <= 0 ? "Yes" : "No") << endl; return 0; }