func_code_string: #include <bits/stdc++.h>   using namespace std;   template <typename T>   void out(T x) {     cout << x << endl;     exit(0);   }   using ll = long long;   const ll mod = 1e9 + 7;   const int maxn = 1e6 + 5;   int n, k;   string S;   bool test(int start) {     string s = S;     int cur = 0;     for (int i = 0; i < start; i++) {       if (s[i] ==  ?  || s[i] ==  Y ) {         s[i] =  Y ;         cur = 0;       } else if (s[i] ==  N ) {         cur++;       }       if (cur > k) return false;     }     if (start > 0 && s[start - 1] ==  N ) {       return false;     }     for (int i = start; i < start + k; i++) {       if (s[i] ==  Y ) {         return false;       }     }     if (start + k < n && s[start + k] ==  N ) {       return false;     }     cur = 0;     for (int i = start + k; i < n; i++) {       if (s[i] ==  ?  || s[i] ==  Y ) {         s[i] =  Y ;         cur = 0;       } else if (s[i] ==  N ) {         cur++;       }       if (cur > k) return false;     }     return true;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> n >> k;     cin >> S;     for (int i = 0; i + k - 1 < n; i++) {       if (test(i)) {         out( YES );       }     }     cout <<  NO n ;     return 0;   }   