/*** * Solution to Substring - CodeIT Season 6, Round 6, Problem S1 * Author - Bozhidar Vasilev **/ #include #include using namespace std; bool check( string s, int l, int k ) { int zero_count = 0; for( int i = 0; i < l; ++i ) { if( s[i] == '0' ) ++zero_count; } if( zero_count < k ) return false; for( int i = l; i < s.size(); ++i ) { if( s[i-l] == '0' ) zero_count--; if( s[i] == '0' ) zero_count++; if( zero_count < k ) return false; } return true; } int main() { freopen("substring.in", "r", stdin); freopen("substring.out", "w", stdout); string s; cin >> s; int l, k; cin >> l >> k; if( check(s,l,k) ) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }