/* -*- coding: utf-8 -*- * * 2109.cc: No.2109 Special Week - yukicoder */ #include #include using namespace std; /* constant */ const int MOY = 12; const int W = 7; const int doms[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; /* typedef */ /* global variables */ bool used[10]; /* subroutines */ inline void check(int x) { used[x / 10] = used[x % 10] = true; } /* main */ int main() { int m, d, k; scanf("%d%d%d", &m, &d, &k); m--; for (int i = 0; i < W; i++) { check(m + 1), check(d); if (++d > doms[m]) m = (m + 1) % MOY, d = 1; } int c = 0; for (int i = 0; i < 10; i++) if (used[i]) c++; if (c >= k) puts("Yes"); else puts("No"); return 0; }