#include #include using namespace std; using namespace atcoder; using ll = long long; using pl = std::pair; using mint = atcoder::modint1000000007; //using mint = atcoder::modint998244353; #define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++) #define all(v) (v).begin(), (v).end() #define dump(var) do{ if(debug::enable) { std::cerr << #var << " : "; debug::print(var); } } while(0); constexpr int di[4] = {1, -1, 0, 0}; constexpr int dj[4] = {0, 0, 1, -1}; constexpr long long inf = 1LL<<60; template inline void chmax(T &a, T b) { a = std::max(a, b); }; template inline void chmin(T &a, T b) { a = std::min(a, b); }; template void vprint(const std::vector& v) { for(int i = 0; i < v.size(); i++) { std::cout << v[i] << (i == v.size()-1 ? "\n" : " "); } } template void vprintln(const std::vector& v) { for(int i = 0; i < v.size(); i++) { std::cout << v[i] << "\n"; } } template void vprint(const std::vector>& v) { for(int i = 0; i < v.size(); i++) { std::cout << v[i].val() << (i == v.size()-1 ? "\n" : " "); } } template void vprintln(const std::vector>& v) { for(int i = 0; i < v.size(); i++) { std::cout << v[i].val() << "\n"; } } namespace debug { #if defined(ONLINE_JUDGE) const bool enable = false; #else const bool enable = true; #endif template void push(const T& e) { std::cerr << e; } template void push(const atcoder::static_modint& e) { std::cerr << e.val(); } template void push(const std::pair& e) { std::cerr << "("; push(e.first); std::cerr << ","; push(e.second); std::cerr << ")"; } template void push(const std::tuple& e) { std::cerr << "("; push(get<0>(e)); std::cerr << ","; push(get<1>(e)); std::cerr << ","; push(get<2>(e)); std::cerr << ")"; } template void print(const T& e) { push(e); std::cerr << "\n"; } template void print(const std::vector& v) { for(int i = 0; i < v.size(); i++) { push(v[i]); std::cerr << " "; } std::cerr << "\n"; } template void print(const std::vector>& v) { std::cerr << "\n"; for(int i = 0; i < v.size(); i++) { std::cerr << i << ": "; print(v[i]); } } }; std::string zfill(const std::string s, size_t size) { assert(s.size() <= size); std::string res = std::string(size - s.size(), '0') + s; return res; } std::string zfill(const long long n, size_t size) { return zfill(std::to_string(n), size); } using date = tuple; date add(date x, ll diff) { const ll days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; auto [month, day, _] = x; day += diff; if(day > days[month]) { month++; day = 1; if(month > 12) month = 1; } string s = zfill(month, 2) + "/" + zfill(day, 2); return date({month, day, s}); } void solve() { ll m, d, k; cin >> m >> d >> k; date now = date({m, d, ""}); set st; rep(i, 0, 7) { now = add(now, i != 0); auto s = get<2>(now); for(auto e : s) st.insert(e); } cout << (st.size() > k ? "Yes" : "No") << endl; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); solve(); return 0; }