#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 set S; void go(int m,int d){ S.insert(m%10); S.insert(m/10); S.insert(d%10); S.insert(d/10); } void nxt(int &m,int &d){ vector t = {0,31,28,31,30,31,30,31,31,30,31,30,31}; d++; if(d>t[m]){ d = 1; m++; if(m==13)m = 1; } } int main(){ int M,D,K; cin>>M>>D>>K; rep(i,7){ go(M,D); nxt(M,D); } if(S.size()>=K)cout<<"Yes"<