#include #include using namespace std; using namespace atcoder; #define rep(i,n) for(int i=0;i<(n);i++) #define per(i,n) for(int i=(n)-1;i>=0;i--) #define all(x) x.begin(),x.end() typedef long long ll; //using mint = modint; using mint = modint998244353; //using mint = modint1000000007; using P = pair; const ll INF=1LL<<60, dx[]={0,1,0,-1},dy[]={1,0,-1,0}; template inline bool chmin(T& a,const T&b) {if(a>b){a=b; return 1;} return 0;} template inline bool chmax(T& a,const T&b) {if(a> m >> d >> k; m--; int month[12]={31,28,31,30,31,30,31,31,30,31,30,31}; vector num(10,false); auto add=[&](int m,int d) -> void { num[(m+1)/10]=true; num[(m+1)%10]=true; num[d/10]=true; num[d%10]=true; }; rep(i,7) { if(d>month[m]) d=1,m=(m+1)%12; add(m,d); d++; } int cnt=0; rep(i,10) if(num[i]) cnt++; cout << ((cnt>=k)?"Yes":"No") << endl; }