#include using namespace std; int main() { int M, D, K; cin >> M >> D >> K; vector m( 12, 31 ); m[1] = 28; m[3] = 30; m[5] = 30; m[8] = 30; m[10] = 30; int l = m[ M - 1 ]; map mp; for( int i = 0; i < 7; i++ ) { char c[8]; sprintf( c, "%02d%02d", M, D ); for( int j = 0; j < 4; j++ ) mp[ c[j] ]++; D++; if( D > l ) { M++; D = 1; } } string ans = "No"; if( (int)mp.size() >= K ) ans = "Yes"; cout << ans << endl; }