Well, the series which Stepan watched for a very long time, ended. In total, the series had n episodes. For each of them, Stepan remembers either that he definitely has watched it, or that he definitely hasn't watched it, or he is unsure, has he watched this episode or not. Stepan's dissatisfaction is the maximum number of consecutive series that Stepan did not watch.Your task is to determine according to Stepan's memories if his dissatisfaction could be exactly equal to k.

The first line contains two integers n and k (1 ≤ n ≤ 100, 0 ≤ k ≤ n) — the number of episodes in the series and the dissatisfaction which should be checked.  The second line contains the sequence which consists of n symbols "Y", "N" and "?". If the i-th symbol equals "Y", Stepan remembers that he has watched the episode number i. If the i-th symbol equals "N", Stepan remembers that he hasn't watched the epizode number i. If the i-th symbol equals "?", Stepan doesn't exactly remember if he has watched the episode number i or not.

If Stepan's dissatisfaction can be exactly equal to k, then print "YES" (without qoutes). Otherwise print "NO" (without qoutes).

NoteIn the first test Stepan remembers about all the episodes whether he has watched them or not. His dissatisfaction is 2, because he hasn't watch two episodes in a row — the episode number 3 and the episode number 4. The answer is "YES", because k = 2.In the second test k = 1, Stepan's dissatisfaction is greater than or equal to 2 (because he remembers that he hasn't watch at least two episodes in a row — number 5 and number 6), even if he has watched the episodes from the first to the fourth, inclusive.

#include <iostream>
#include <vector>
#include <string>

using namespace std;

bool check(string &s, int k, int ind)
{
    int cntr = 0;
    for (int i = ind; i < s.size(); i++)
    {
        if (s[i] == 'N' || s[i] == '?')
        {
            cntr++;
        }
        else if (s[i] == 'Y' && cntr < k)
            return false;
        if (cntr == k)
        {
            if (i == s.size() - 1)
                return true;
            else if (s[i+1] != 'N')
                return true;
            else
                return false;
        }
    }
    return false;
}

int main()
{
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;

    int cnt = (s[0] == 'N' ? 1 : 0), maxcnt = 0;

    for (int i = 1; i < s.size(); i++)
    {
        if (s[i] == 'N' && s[i-1] == 'N')
            cnt++;
        else if (s[i] == 'N')
            cnt = 1;
        else
        {
            maxcnt = max(cnt, maxcnt);
            cnt = 0;
        }
        maxcnt = max(cnt, maxcnt);
    }
    maxcnt = max(cnt, maxcnt);
    if (maxcnt > k)
    {
        cout << "NO" << endl;
        return 0;
    }
    else if (maxcnt == k)
    {
        cout << "YES" << endl;
        return 0;
    }

    bool ok = check(s, k, 0);
    if (ok)
    {
        cout << "YES" << endl;
        return 0;
    }
    for (int i = 1; i < s.size(); i++)
        if ((s[i] == 'N' || s[i] == '?') && s[i-1] != 'N')
        {
            ok = check(s, k, i);
            if (ok)
                break;
        }

    if (ok)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
    return 0;
}

#include <iostream>

using namespace  std;

int main(){
	int n, k;
	cin >> n >> k;
	string s;
	cin >> s;
	int min = 0;
	for (int i = 0; i<n; i++){
	    if (s[i] == 'N'){
	        int c = 0;
	        while ((i < n) && (s[i] == 'N')){
	            i++;
	            c++;
	            if (min < c)
	                min = c;
	        }
	    }
	}
	if (k < min){
	    cout << "NO";
	    return 0;
	}
	for (int i = 0; i <= n-k; i++){
	    if ((i > 0) && (s[i-1] == 'N'))
	        continue;
	    bool f = true;
	    for (int j = 0; j < k; j++)
	        if (s[i+j] == 'Y')
	            f = false;
	    if ((i+k < n) && (s[i+k] == 'N'))
	        f = false;
	    if (f){
	        cout << "YES";
	        return 0;
	    }
	}
	cout << "NO";
	return 0;
}

#include <iostream>

using namespace std;

int main()
{
    bool f;
    int n,m,i,c,mx;
    string s, s2;
    cin >> n >> m;
    cin >> s;
    for (int i = 0; i < n - m + 1; i++) {
        c = 0;
        mx = 0;
        f = false;
        s2 = s;
        for (int j = i; j <= i + m - 1; j++ ) {
            if (s2[j] == 'Y') {
                f = true;
                break;
            }
        }
        if (!f) {
            for (int j = i; j <= i + m - 1; j++ ) {
                s2[j] = 'N';
            }
            for (int j = 0; j < n; j++) {
                if (s2[j] == 'N') {
                    c++;
                    if (c > mx) {
                        mx = c;
                    }
                }
                else {
                    c = 0;
                }
            }
            if (mx == m) {
                cout << "YES";
                return 0;
            }
        }
    }
    cout << "NO";
    return 0;
}

//http://codeforces.com/problemset/problem/774/J

#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iterator>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#include <iomanip>
#include <fstream>

using namespace std;

typedef pair <int, int> pii;
typedef pair <long long, long long> pll;
typedef long long ll;
typedef unsigned long long ull;

#define endl "\n"
#define mp make_pair

const int mod = 1000000007;
const int INF = 1000000000;

int n, k, sum[105];
string result = "NO";

int get(int l, int r);

int main() {
	string str;

	ios::sync_with_stdio(false);
	cin.tie(NULL);

	cin >> n >> k >> str;

	for (int i = 0; i < n; i++) {
		if (str[i] == 'Y')
			sum[i] = 105;
		else if (str[i] == 'N')
			sum[i] = 1;
	}

	for (int i = 1; i < n; i++)
		sum[i] += sum[i - 1];

	for (int i = 0; i < n; i++) {
		int j = i + k - 1;

		if (j >= n)
			break;

		if ((get(i, j) <= k) && ((i == 0) || (str[i - 1] != 'N')) && ((j == n - 1) || (str[j + 1] != 'N')))
			result = "YES";
	}

	for (int i = 0; i < n; i++) {
		int j = i + k;

		if (j >= n)
			break;

		if (get(i, j) == k + 1)
			result = "NO";
	}

	cout << result << endl;

	return 0;
}

int get(int l, int r) {
	if (l == 0)
		return sum[r];

	return sum[r] - sum[l - 1];
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll n,k;
    cin>>n>>k;
    string s;
    cin>>s;
    for(ll i=0;i<s.length();i++)
    {
        string t = s;
        for(ll j=0;j<s.length();j++)
        {
            if(j>=i && j<i+k && s[j]=='?')
            {
                t[j] = 'N';
            }

        }
        ll ans = 0, cnt=0;
        for(ll j=0;j<s.length();j++)
        {
            if(t[j]=='N')
            {
                cnt++;
            }
            else{
                cnt=0;
            }
            ans = max(ans, cnt);
        }
        if(ans == k)
        {
            cout<<"YES"<<endl;
            return 0;
        }
    }
    cout<<"NO"<<endl;
}

#include <bits/stdc++.h>

using namespace std;

string s;

int main() {
 int n, k;
 cin >> n >> k >> s;
 s = "Y" + s + "Y";
queue<int> q; int d = 0; int mn = 0; int ok = 0;
 for(int i = 0; i <= n+1; i++) {
  while(q.size() && i - q.front() - 1 > k) q.pop();
  if(s[i] != 'N') {
   if(q.size() && i - q.front() - 1 == k) ok = 1;
   d = 0;
   if(s[i] == 'Y') while(q.size()) q.pop();
   q.push(i);
  }
  else mn = max(mn, ++d);
 }
 if(ok && mn <= k) cout << "YES" << endl;
 else cout << "NO" << endl;
}

#include <iostream>
#include <fstream>
#include <string>
#include <queue>

using namespace std;

void clean(queue<int>& q)
{
	while (!q.empty())
		q.pop();
}

bool processNegative(int& currentNegative, queue<int>& questions,
	int&i, int k)
{
	++currentNegative;

	if (currentNegative > k)
	{
		if (!questions.empty())
		{
			i = questions.front();
			clean(questions);
			currentNegative = 0;
		}
		else
		{
			cout << "NO" << endl;
			return false;
		}
	}

	return true;
}

int main()
{
	//ifstream cin("input.txt");

	int n, k;
	string str;
	cin >> n >> k >> str;

	str += "Y";

	auto currentNegative = 0;
	auto hadResult = false;

	queue<int> questions;

	for (auto i = 0; i < str.size(); i++)
	{
		switch (str[i])
		{
		case 'Y':
			if (currentNegative == k)
				hadResult = true;

			currentNegative = 0;
			clean(questions);
			break;
		case 'N':
			if (!processNegative(currentNegative, questions, i, k))
				return 0;
			break;
		case '?':
			if (currentNegative == k)
				hadResult = true;

			questions.push(i);
			if (!processNegative(currentNegative, questions, i, k))
				return 0;
			break;
		}
	}

	cout << (hadResult ? "YES" : "NO");
}

// Author : Sarthak Kapoor
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define rep(i,n) for(int i=0;i<n;++i)
#define repa(i,a,n) for(int i=a;i<n;++i)
#define repr(i,n) for(int i=n-1;i>=0;--i)
#define repba(i,b,a) for(int i=b;i>=a;--i)
#define repab(i,a,b) for(int i=a;i<b;++i)
#define ll long long
#define pi pair<int,int>
#define pii pair<pi,int>
#define ull unsigned long long
#define vi vector<int>
#define viip vector<pair<int,pair<int,int> > >
#define mp make_pair
#define vip vector<pair<int,int> >
#define pb push_back
#define fi first
#define sec second
#define all(v) v.begin(),v.end()
#define s(v) v.size()
ll mod = 1000000007;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());//use rng()%n for numbers in range [0,n-1]
ll gcd(ll a,ll b){
	if(b==0)return a;
	return gcd(b,a%b);
}
ll fastexp(ll x,ll a){
    ll res = 1;
    while(a>0){
        if(a&1){
            res = (res*x)%mod;
        }
        a=a>>1;
        x=(x*x)%mod;
    }
    return res;
}
ll inverse(ll n){
    return fastexp(n,mod-2);
}
template <typename T>
void add(T &a, T b){
	a += b;
	if(a >= mod)a -= mod;
}
template <typename T>
void sub(T &a, T b){
	a -= b;
	if(a < 0)a += mod;
}
template <typename T>
void mul(T &a, T b){
	a *= b;
	if(a >= mod)a %= mod;
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n,k;
	cin>>n>>k;
	string s;
	cin>>s;
	// int a = 0;
	int flag = 0;
	rep(i,n){
		int j = i+k-1;
		if(j >= n)break;
		int f = 0;
		repa(k,i,j+1){
			if(s[k] == 'Y'){
				// if(i == 2){
				// 	cout<<k<<"\n";
				// }
				f = 1;
				break;
			}
		}
		// if(i == 2){
		// 	cout<<f<<"\n";
		// }
		if(f == 0){
			if(i > 0 && s[i-1] == 'N'){
				// cout<<i<<"\n";
				continue;
			}
			if(j < n-1 && s[j+1] == 'N'){
				// cout<<i<<"\n";
				continue;
			}
			flag = 1;
			break;
		}
	}
	int a = 1;
	rep(i,n){
		int j = i+k;
		if(j >= n)break;
		int f = 0;
		repa(k,i,j+1){
			if(s[k] == '?' || s[k] == 'Y'){
				f = 1;
				break;
			}
		}
		if(f == 0){
			// cout<<i<<"\n";
			a = 0;
			break;
		}
	}
	// cout<<a<<"\n";
	if(a == 1 && flag == 1){
		cout<<"YES\n";
	}
	else{
		cout<<"NO\n";
	}
	return 0;
}

#include <iostream>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <bitset>
using namespace std;

#define in(s) freopen(s, "r", stdin);
#define out(s) freopen(s, "w", stdout);
#define forn(i, n) for (int i = 0; i < n; i++)
#define endl '\n'

typedef long long ll;
typedef long double ld;

int main()
{
	//in("cakes.in");
	//out("cakes.out");
	srand(1373737);
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int n, k;
	cin >> n >> k;

	string s;
	cin >> s;

	int p = 0, len = 0;
	while (p < s.size())
	{
		if (s[p] != 'N')
		{
			p++;
			continue;
		}
		int now = 0;
		while (p < s.size() && s[p] == 'N')
		{
			now++;
			p++;
		}
		len = max(len, now);
	}
	if (len > k)
	{
		cout << "NO";
		return 0;
	}
	if (k == 0)
	{
		cout << "YES";
		return 0;
	}
	vector <bool> fix(n);
	forn(i, n)
	{
		if (s[i] == '?')
			s[i] = 'N';
		else
			fix[i] = true;
	}
	p = 0; len = 0;
	while (p < s.size())
	{
		if (s[p] != 'N')
		{
			p++;
			continue;
		}
		int now = 0, start = p;
		while (p < s.size() && s[p] == 'N')
		{
			now++;
			if (now == k)
			{
				if ((start - 1 < 0 || (!fix[start - 1] && s[start - 1] == 'N' || s[start - 1] == 'Y')) && (p + 1 >= n || (!fix[p + 1] && s[p + 1] == 'N' || s[p + 1] == 'Y')))
				{
					cout << "YES";
					return 0;
				}
				else
				{
					now--;
					start++;
				}
			}
			p++;
		}
	}
	cout << "NO";
	return 0;
}

#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <list>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cassert>
#include <ctime>
#include <cctype>
#include <cstring>
#include <bitset>
#include <algorithm>
#include <iomanip>

#define ld long double
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define y0 _y0
#define y1 _y1

using namespace std;

template < typename T > T abs(T x)
{
    return x > 0 ? x : -x;
}

template < typename T > T sqr(T x)
{
    return x * x;
}

bool dp[105][105][105];

int main()
{
	int n, k;
	string s;

	cin >> n >> k;
	cin >> s;

	s.pb('Y');
	n++;

	dp[0][0][0] = 1;

	for (int i = 0; i < n; i++)
		for (int gap = 0; gap <= n; gap++)
			for (int mx = 0; mx <= n; mx++) {
				if (!dp[i][gap][mx]) continue;
				if (s[i] == 'Y') {
					dp[i + 1][0][max(mx, gap)] = 1;
				}
				if (s[i] == 'N') {
					dp[i + 1][gap + 1][mx] = 1;
				}
				if (s[i] == '?') {
					dp[i + 1][0][max(mx, gap)] = 1;
					dp[i + 1][gap + 1][mx] = 1;
				}
			}

	bool ans = dp[n][0][k];

	cout << (ans ? "YES" : "NO") << "\n";

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long n, k;
    string s;
    cin >> n >> k;
    cin >> s;
    long long t = 0;
    for(long long i = 0, cur = 1; i < n; i++, cur++){
        if(s[i] != 'N') cur = 0;
        t = max(t, cur);
    }
    if(t > k){
        cout << "NO";
        return 0;
    }
    s = "Y" + s;
    s = s + "Y";
    for(int l = 1, r = l + k - 1; r <= n; l++, r++){
        if(s[l - 1] != 'N' && s[r + 1] != 'N'){
            bool ans = 1;
            for(int i = l; i <= r; i++) ans = min(ans, !(s[i] == 'Y'));
            if(ans){
                cout << "YES";
                return 0;
            }
        }
    }
    cout << "NO";
    return 0;
}

#include <cstdlib>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <list>
#include <string>
#include <vector>
#include <sstream>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <cmath>
#include <functional>

typedef long long long64;
typedef long long int64;
using namespace std;

int main()
{
    //freopen("input.txt", "r", stdin);

		int n;
		int k;
		cin >> n >> k;

	    string a;
	    cin >> a;
bool no=false;
for(int i=0; i<a.size(); i++)
{
    if(a[i]=='N' && (i+k)<=a.size() && (i==0 || a[i-1]!='N'))
    {
       int count=0;
       int j;
       for(j=i; j<i+k; j++)
        {
            //cout << a[j];
            if(a[j]=='N')
                count ++;
            else
                break;
        }
        //cout << endl;
        if(count==k && j<a.size() && a[j]=='N')
        {
            cout << "NO";
            return 0;
        }
    }
}
for(int i=0; i<a.size(); i++)
{
	if((i+k)<=a.size() && (i==0 || a[i-1]!='N'))
    {
       int count=0;
       int j;
       for(j=i; j<i+k; j++)
        {
            //cout << a[j];
            if(a[j]=='?' || a[j]=='N')
                count ++;
            else
                break;
        }
        //cout << endl;
        if(count==k && (i+k==a.size() || a[j]!='N'))
        {
            cout << "YES";
            return 0;
        }
    }
}

    cout << "NO";

	return 0;
}

#include<bits/stdc++.h>

#define mp make_pair
#define pb push_back
#define forn(i, n) for (int i = 0; i < n; i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define X first
#define Y second
#define y1 matveylox

using namespace std;

const int N = 400001;
const ll MAXN = (ll)1e6 + 7;
const int INF = (int)1e7;
const ll LINF = (ll)1e18;
const ll MOD = (ll)1e6 + 7;
const double eps = 0.00000000001;

int main()
{
    //freopen("input1.txt", "r", stdin);
    //freopen("cubes.out", "w", stdout);
    int n, v;
    string s;
    cin >> n >> v;
    cin >> s;
    forn(i, v + 1)
        s += "#";
    s = "#" + s;
    int k = 0;
    int ansk = 0, ansc = 0;
    forn(i, s.size())
    {
        if (s[i] == 'N')
            k++;
        else
        {
            ansk = max(ansk, k);
            k = 0;
        }
    }
    if (v < ansk)
        cout << "NO", exit(0);
    for(int i = 1; i <= n; i++)
    {
        bool f = true;
        for(int j = i; j < i + v; j++)
            if (s[j] == 'Y' || s[j] == '#')
                f = false;
        if (f)
            if (s[i - 1] != 'N' && s[i + v] != 'N')
                cout << "YES", exit(0);
    }
    cout << "NO";
    return 0;
}

#include <stdio.h>

int main() {
    int n, k;
    char str[1000];
    scanf("%d %d",&n, &k);
    scanf("%s", str);

    int maxC = 0;
    int tc = 0;
    for (int i = 0; i < n; i++) {
        if (str[i] == 'N') {
            tc++;
            maxC = tc > maxC ? tc : maxC;
        } else {
            tc = 0;
        }
    }

    if (maxC > k) {
        printf("NO");
        return 0;
    }

    for (int i = 0; i < n; i++) {
        int matching = 0;
        for (int j = 0; j < k; j++) {
            if (i + j >= n) {
                break;
            }
            if (str[i + j] == 'Y') {
                break;
            }
            if (str[i + j] == '?' || str[i + j] == 'N') {
                matching += 1;
            }
        }
        if (i - 1 >= 0 && str[i - 1] == 'N') {
            matching -= 1;
        }
        if (i + k < n && str[i + k] == 'N') {
            matching -= 1;
        }
        if (matching == k) {
            // printf("%d\n", i);
            printf("YES");
            return 0;
        }
    }
    printf("NO");
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define pa pair<int,int>
const int Maxn=110;
const int inf=2147483647;
int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return x*f;
}
int n,k;char s[Maxn];
bool f[Maxn][Maxn][Maxn];
//到i 最长为j 延伸l
int main()
{
	memset(f,false,sizeof(f));
	n=read(),k=read();
	scanf("%s",s+1);
	f[0][0][0]=true;
	for(int i=0;i<n;i++)
	for(int j=0;j<=k;j++)
	for(int l=0;l<=i;l++)
	if(f[i][j][l])
	{
		if(s[i+1]=='?')
		{
			f[i+1][max(j,l+1)][l+1]=true;
			f[i+1][j][0]=true;
		}
		else if(s[i+1]=='N')f[i+1][max(j,l+1)][l+1]=true;
		else f[i+1][j][0]=true;
	}
	for(int i=0;i<=n;i++)if(f[n][k][i])return puts("YES"),0;
	puts("NO");
}

#include <algorithm>
#include <vector>
#include <iostream>
#include <queue>
#include <cmath>

using namespace std;

int main() {
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    int cnt = 0, cntmax = 0;
    if (n == k) {
        for (int i = 0; i < n; i++) {
            if (s[i] == 'Y') {
                cout << "NO" << endl;
                return 0;
            }
        }
    }
    if (s[0] == 'N') {
        cnt = 1;
    }
    for (int i = 1; i < n; i++) {
        if (s[i] == 'N') {
            cnt++;
        } else {
            if (cntmax < cnt) {
                cntmax = cnt;
            }
            cnt = 0;
        }
    }
    if (cntmax < cnt) {
        cntmax = cnt;
    }
    if (cntmax > k) {
        cout << "NO" << endl;
        return 0;
    }
    for (int i = 1; i < n - k; i++) {
        bool flag = 0;
        for (int j = 0; j < k; j++) {
            if (s[i + j] == 'Y') {
                flag = 1;
                break;
            }
        }
        if ((s[i + k] == 'Y' || s[i + k] == '?') && (s[i - 1] == 'Y' || s[i - 1] == '?') && !flag) {
            cout << "YES" << endl;
            return 0;
        }
    }
    bool flag = 0;
    for (int i = 0; i < k; i++) {
        if (s[i] == 'Y') {
            flag = 1;
            break;
        }
    }
    if (flag == 0 && s[k] != 'N') {
        cout << "YES" << endl;
        return 0;
    }
    flag = 0;
    for (int i = n - k; i < n; i++) {
        if (s[i] == 'Y') {
            flag = 1;
            break;
        }
    }
    if (flag == 0 && s[n - k - 1] != 'N') {
        cout << "YES" << endl;
        return 0;
    }
    cout << "NO" << endl;
}

#include <bits/stdc++.h>
using namespace std;

int n, k;
char a[105];
bool vis[105][105][105];
bool memo[105][105][2];

bool dp(int i, int x, int flag) {
    if (x < 0) return false;
    if (i == -1) return (x == 0 || flag);
    if (vis[i][x][flag]) return memo[i][x][flag];
    vis[i][x][flag] = true;
    if (x == 0) flag = true;
    if (a[i] == 'N') return memo[i][x][flag] = dp(i-1, x-1, flag);
    else if (a[i] == 'Y') return memo[i][x][flag] = dp(i-1, k, flag);
    else return memo[i][x][flag] = (dp(i-1, x-1, flag) || dp(i-1, k, flag));
}

int main() {
    //freopen("in.txt", "r", stdin);
    scanf("%d%d", &n, &k);
    for (int i = 0; i < n; ++i) scanf(" %c", &a[i]);
    memset(vis, 0, sizeof vis);
    printf("%s\n", dp(n-1, k, 0) ? "YES" : "NO");
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define SET(x, a) memset(x, a, sizeof x);
#define mp make_pair
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define fi first
#define se second
#define pld pair<ld, ld>
const ll MOD = 1000000007;
const ll INF = 1000000000;
template <class T> inline void read(T &x) {
  char c;
  int flag = 1;
  while ((c = getchar()) < '0' || c > '9')
    if (c == '-')
      flag *= -1;
  x = c - '0';
  while ((c = getchar()) >= '0' && c <= '9')
    x = x * 10 + c - '0';
  x *= flag;
  return;
}
bool dp[105][105];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  string x;
  cin >> x;
  x = "#" + x;
  dp[0][0] = 1;
  int cnt = 0;
  int mx = 0;
  for (int i = 1; i <= n; ++i) {
    if (x[i] == 'Y' || x[i] == '?')
      cnt = 0;
    else if (x[i] == 'N')
      cnt++;
    mx = max(mx, cnt);
  }
  if (mx > k)
    return cout << "NO" << endl, 0;
  for (int i = 1; i <= n; ++i) {
    if (x[i] == 'Y' || x[i] == '?') {
      if (dp[i - 1][k])
        return cout << "YES" << endl, 0;
      dp[i][0] = 1;
    }
    if (x[i] == 'N' || x[i] == '?') {
      for (int j = 0; j < n; ++j)
        dp[i][j + 1] |= dp[i - 1][j];
    }
  }
  cout << (dp[n][k] ? "YES" : "NO") << endl;
}

#include <bits/stdc++.h>

using namespace std;

#define mp make_pair
#define pb push_back
#define makeunique(x) sort(all(x)), (x).resize(unique(x) - (x).begin())
#define re return
#define fi first
#define se second
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define sqrt(x) sqrt(abs(x))
#define y0 y3487465
#define y1 y8687969
#define j0 j5743892
#define j1 j542893

typedef vector<int> vi;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef double D;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef vector<vi> vvi;

template<class T> T abs(T x) { re x > 0 ? x : -x; }
template<class T> T gcd(T a, T b) { re a ? gcd (b % a, a) : b; }
template<class T> T sqr(T a) { re a * a; }
template<class T> T sgn(T a) { re a > 0 ? 1 : (a < 0 ? -1 : 0); }

#define filename ""

int n;
int m;

const int N = 101;
bool was[N][N][N], ans;
char s[N];

void go (int i, int j, int k)
{
	if (i == n) {
		ans |= k == m;
		re ;
	}
	if (was[i][j][k]) re ;
	if (s[i] == 'N') go (i + 1, j + 1, max(j + 1, k));
	else if (s[i] == 'Y') go (i + 1, 0, k);
	else if (s[i] == '?') go (i + 1, 0, k), go (i + 1, j + 1, max(j + 1, k));
	was[i][j][k] = true;
	re ;
}

int main () {
//	freopen (filename".in", "r", stdin);
//	freopen (filename".out", "w", stdout);
	scanf ("%d%d ", &n, &m);
	gets (s);
	go (0, 0, 0);
	if (ans) puts ("YES");
	else puts("NO");

	return 0;
}

#include<bits/stdc++.h>
 using namespace std;

 int n, k, i, j, ans,val,l,mx = 0;
 string s;

 int main(){

    cin >> n >> k;
    cin >> s;

    for(i=0;i<s.size();++i){
        if(s[i]=='N'){
            ++ans;
            if(ans>k) return cout<<"NO\n",0;
            mx=max(mx,ans);
        } else{
            ans = 0;
        }
    }

    if(mx == k) return cout <<"YES\n",0;

    for(i = 0; i < s.size(); ++i)
    for(j = i; j < s.size(); ++j){
            val  = 0;
            int mx = 0;
        for(l = 0; l < s.size(); ++l)
        if(s[l] == 'N'){
            ++val;
        } else{
        if(s[l]=='?'){
            if(l>=i && l<=j){
                ++val;
            }
           else {
            mx=max(mx,val);
            val = 0;
        }
        } else{
            mx=max(mx,val);
            val = 0;
        }
    }
    mx=max(mx,val);
    if(mx==k)return cout<<"YES\n",0;
    }

    return cout << "NO\n", 0;

 }

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define PI 3.1415926535
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef pair <ll, ll> pll;

bool check(string &s, ll k) {
    ll cnt = 0;
    for(auto i: s) {
        if(i == 'N') cnt++;
        else cnt = 0;
        if(cnt > k) return false;
    }
    return true;
}

int main(){
    ios_base:: sync_with_stdio(0);
    //start();
    ll n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    if(!check(s, k)) {
        cout << "NO";
        return 0;
    }
    if(k == 0) {
        cout << "YES";
        return 0;
    }
    for(ll i = 0; i < n; i++) {
        if((s[i] == '?' || s[i] == 'N') && (i == 0 || s[i - 1] != 'N')) {
            ll cnt = 0;
            while(i + cnt < n && ((s[i + cnt] == '?' && cnt < k) || s[i + cnt] == 'N')) {
                cnt++;
            }
            //cout << cnt << endl;
            if(cnt == k) {
                cout << "YES";
                return 0;
            }
        }
    }
    cout << "NO";
    return 0;
}

#include <bits/stdc++.h>
#define FOR(i, a, b)    for(int i = a; i <= b; i++)
#define REP(i, a, b)    for(int i = a; i >= b; i--)
#define x               first
#define y               second
#define ii              pair <int, int>
#define iii             pair <ii, int>
#define iv              pair <ii, ii>
#define maxN            200005
#define ll              long long
#define inf             (int) 2e9
#define mode            1000000007

using namespace std;

int n, k;
char a[maxN];

bool ok(int u, int v) {
    FOR(i, u, v) if(a[i] == 'Y') return false;
    if(a[u - 1] == 'N') return false;
    if(a[v + 1] == 'N') return false;
    return true;
}

void solve() {
    cin >> n >> k >> a + 1;
    int ans = 0, cur = 0;
    FOR(u, 1, n) {
        if(a[u] == 'N') cur++, ans = max(ans, cur);
        else cur = 0;
    }
    if(ans > k) {cout << "NO"; return;}
    FOR(u, 1, n - k + 1) {
        int v = u + k - 1;
        if(ok(u, v)) {cout << "YES"; return;}
    }
    cout << "NO";
}

//#define AN "something"

int main() {
    #ifdef AN
        freopen(AN".inp", "r", stdin);
        freopen(AN".out", "w", stdout);
    #else
        //freopen("main.inp", "r", stdin);
    #endif // AN
    solve();
}

#include <bits/stdc++.h>
using namespace std;

int32_t main() {
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;

    for (int i = 0; i < n; i++) {
        int j = i;
        while (j < n && s[j] == 'N') {
            j++;
        }

        if (j - i > k) {
            cout << "NO\n";
            return 0;
        }
    }

    vector<int> p;
    for (int i = 0; i < n; i++) {
        if (s[i] == 'Y') {
            p.push_back(i);
        }
    }

    bool found = false;
    for (int i = 0; i <= n - k; i++) {
        bool has_yes = false;
        int idx = lower_bound(p.begin(), p.end(), i) - p.begin();
        has_yes = (idx < (int)p.size()) && p[idx] < i + k;
        if (has_yes) continue;

        if ((i - 1 < 0 || s[i - 1] == 'Y' || s[i - 1] == '?') && (i + k >= n || s[i + k] == 'Y' || s[i + k] == '?')) {
            found = true;
            break;
        }
    }

    cout << (found ? "YES" : "NO") << '\n';

    return 0;
}

#include "bits/stdc++.h"
using namespace std;
#include "vector"
#define endl '\n'
#ifndef dgb
#define dbg(...)
#define dbgv(x)
#define debug(...)
#endif
#define pb push_back
#define eb emplace_back
#define rep(i, a, b) for(auto i = a;i != b;i++)
#define brep(i, a, b) for(auto i = a;i >= b;i--)
#define repi(i, a, b) for(auto i = a;i <= b;i++)
template<class t>t mag(t a){return a>0?a:-a;}
template <class T, class U>auto cdiv(T num,U den){return (num/den)+((num%den)>0);}
std::ifstream term("/dev/tty");std::string tempstring;
using ll=long long;using ii=pair<int,int>;using vi=vector<int>;
using vl=vector<ll>;using vii = vector<ii>;
const int &sij = 110;const ll &mod = 1000000007ll;
int n, k, dp[sij][4];
string s;
int dfs(int ind, int state){
  debug(ind, state);
  if(ind == n and state == 2){
    cout << "YES";
    exit(0);
  }
  if(ind == n)  return 0;
  if(dp[ind][state] != -1)  return dp[ind][state];
  dp[ind][state] = 0;
  int mini = ind + 1, maxi = min(n, ind + k + 1);
  repi(x, mini, maxi){
    if(s[x] == 'Y'){
      if(ind + k + 1 == x){
        dp[ind][state] |= dfs(ind + k + 1, 2);
      }
      return dp[ind][state] |= dfs(x, state);
    }
    if(s[x] == '?'){
      if(ind + k + 1 == x){
        dp[ind][state] |= dfs(ind + k + 1, 2);
      }
      dp[ind][state] |= dfs(x, state);
    }
  }
  return dp[ind][state];
};
int esc(int tc){
  cin >> n >> k >> s;
  s.push_back('Y');
  int cmini = 0, cons = 0;
  repi(i, 0, n){
    if(s[i] == 'N') cons++;
    else{
      cmini = max(cmini, cons);
      cons = 0;
    }
  }
  if(k == cmini){
    cout << "YES";return 0;
  }
  if(k < cmini){
    cout << "NO";return 0;
  }
  debug(n, k);
  memset(dp, -1, sizeof(dp));
  repi(i, 0, k){
    if(s[i] == 'Y'){
      if(i == k)
        dfs(i, 2);
      else
        dfs(i, 1);
      break;
    }
    else if(s[i] == '?'){
      if(i == k)
        dfs(i, 2);
      else
        dfs(i, 1);
    }
  }
  cout << "NO";
  return 0;
}
int main(){
  ios_base::sync_with_stdio(0);
#ifndef sep
  cin.tie(0);
  cout.tie(0);
#endif
  int tc = 1;
  // cin >> tc;
  for(int i = 1;i <= tc;i++)
    esc(i);
#ifdef sep
  cerr << "\n\nTime : "<<1.0* clock()/CLOCKS_PER_SEC << "s.\n\n";
#endif
}

#include <bits/stdc++.h>

using namespace std;

string s;

int main() {
 int n, k;
 cin >> n >> k >> s;
 s = "Y" + s + "Y";
queue<int> q; int d = 0; int mn = 0; int ok = 0;
 for(int i = 0; i <= n+1; i++) {
  while(q.size() && i - q.front() - 1 > k) q.pop();
  if(s[i] != 'N') {
   if(q.size() && i - q.front() - 1 == k) ok = 1;
   d = 0;
   if(s[i] == 'Y') while(q.size()) q.pop();
   q.push(i);
  }
  else mn = max(mn, ++d);
 }
 if(ok && mn <= k) cout << "YES" << endl;
 else cout << "NO" << endl;
}

#include <bits/stdc++.h>
using namespace std;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

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;
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

	typedef tree<
			int,
			null_type,
			less<int>,
			rb_tree_tag,
			tree_order_statistics_node_update>
	ordered_set;

#define ll long long
ll check(string str){
	ll ans=0,temp=0;
	for(int i=0;i<(int)str.length();i++){
		if(str[i]=='N') temp++;
		else{
			ans=max(ans,temp);
			temp=0;
		}
	}
	return max(ans,temp);
}

int main(){
	ios::sync_with_stdio(false);cin.tie(0);
	ll n,k;cin>>n>>k;
	string str;cin>>str;
	for(int i=0;(i+k-1)<(int)str.length();i++){
		ll j=i+k-1;
		string temp=str;
		for(int x=0;x<i;x++){
			if(temp[x]=='?'){
				temp[x]='Y';
			}
		}
		for(int x=i;x<=j;x++){
			if(temp[x]=='?'){
				temp[x]='N';
			}
		}
		for(int x=j+1;x<(int)str.length();x++){
			if(temp[x]=='?'){
				temp[x]='Y';
			}
		}
		if(check(temp)==k) {
			cout<<"YES"<<endl;
			return 0;
		}
	}
	cout<<"NO"<<endl;
	return 0;

}

#include<bits/stdc++.h>
using namespace std;

#define ll       long long int
#define ull      unsigned long long int
#define pb       push_back
#define vpop     pop_back
#define mp       make_pair
#define ff       first
#define ss       second
#define clz(x)   __builtin_clz(x)       //count leading zeroes
#define ctz(x)   __builtin_ctz(x)       //count trailing zeroes
#define sbts(x)  __builtin_popcount(x) //count set bits
#define ps(x, y) fixed << setprecision(y) << x
#define all(v)   v.begin(), v.end()
#define umap	 unordered_map
const int MOD  =  1e9 + 7;
const ll INF   =  1e12;
int n, k;
int memo[101][101][101];

int solve(string &str, int i, int N, int _max) {
    _max = max(N, _max);
    int &a = memo[i][N][_max];
    if(a != -1) return a;
    if(i == n) {
        if(_max == k)  return a = 1;
        return a = 0;
    }
    if(str[i] == 'Y')
        return a = solve(str, i+1, 0, _max);
    else if(str[i] == 'N')
        return a = solve(str, i+1, N+1, _max);
    else {
        if(solve(str, i+1, 0, _max))   return a = 1;
        return a = solve(str, i+1, N+1, _max);
    }
    return a = 0;
}

int main() {
    // freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    memset(memo, -1, sizeof(memo));
    cin >> n >> k;
    string str;
    cin >> str;
    if(solve(str, 0, 0, 0))
        cout << "YES";
    else
        cout << "NO";
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

#define ll       long long int
#define ull      unsigned long long int
#define pb       push_back
#define vpop     pop_back
#define mp       make_pair
#define ff       first
#define ss       second
#define clz(x)   __builtin_clz(x)       //count leading zeroes
#define ctz(x)   __builtin_ctz(x)       //count trailing zeroes
#define sbts(x)  __builtin_popcount(x) //count set bits
#define ps(x, y) fixed << setprecision(y) << x
#define all(v)   v.begin(), v.end()
#define umap	 unordered_map
const int MOD  =  1e9 + 7;
const ll INF   =  1e12;
int n, k;
int memo[101][101][101];

// Memoization based Soution
int solve(string &str, int i, int N, int _max) {
    _max = max(N, _max);
    int &a = memo[i][N][_max];
    if(a != -1) return a;
    if(i == n)  return a = (_max == k);
    if(str[i] != 'N') {
        bool temp1 = solve(str, i+1, 0, _max);
        if(str[i] == 'Y' || temp1)   return a = temp1;
    }
    return a = solve(str, i+1, N+1, _max);
}

int main() {
    ios_base::sync_with_stdio(false);   cin.tie(NULL);
    memset(memo, -1, sizeof(memo));
    cin >> n >> k;
    string str; cin >> str;
    cout << (solve(str, 0, 0, 0)? "YES": "NO");
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

#define ll       long long int
#define ull      unsigned long long int
#define pb       push_back
#define vpop     pop_back
#define mp       make_pair
#define ff       first
#define ss       second
#define clz(x)   __builtin_clz(x)       //count leading zeroes
#define ctz(x)   __builtin_ctz(x)       //count trailing zeroes
#define sbts(x)  __builtin_popcount(x) //count set bits
#define ps(x, y) fixed << setprecision(y) << x
#define all(v)   v.begin(), v.end()
#define umap	 unordered_map
const int MOD  =  1e9 + 7;
const ll INF   =  1e12;
int n, k;
int memo[101][101][101];

int solve(string &str, int i, int N, int _max) {
    _max = max(N, _max);
    int &a = memo[i][N][_max];
    if(a != -1) return a;
    if(i == n)  return a = ((_max == k)? 1: 0);
    if(str[i] != 'N') {
        bool temp1 = solve(str, i+1, 0, _max);
        if(str[i] == 'Y' || temp1)   return a = temp1;
    }
    return a = solve(str, i+1, N+1, _max);
}

int main() {
    ios_base::sync_with_stdio(false);   cin.tie(NULL);
    memset(memo, -1, sizeof(memo));
    cin >> n >> k;
    string str; cin >> str;
    cout << (solve(str, 0, 0, 0)? "YES": "NO");
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

// IIT se hain BC!  //

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n,k;
	cin>>n>>k;
	char str[n];
	cin>>str;
	bool flag=false;
	for (int i = 0; i <= n-k; ++i){
		int count=0,qm=0,fqm=-1;
		bool flag1=false;
		bool flag2=false;
		for (int j = 0; j < k; ++j){
			if(str[i+j]!='Y')
				count+=1;
			if(str[i+j]=='?'){
				if(qm==0)
					fqm=i+j;
				qm+=1;
			}
		}
		if(count==k){
			// cout<<str[i+k]<<" HERE"<<endl;
			if(i>0&&str[i-1]=='N'){
				if(qm==0){
				// cout<<"here1"<<endl;
				flag=false;
				break;
				}
				else{
					str[fqm]='Y';
					continue;
				}

			}
			if(i<n-k&&str[i+k]=='N'){
				if(qm==0){
				// cout<<i+k<<" here2"<<endl;
				flag=false;
				break;
				}
				else{
					str[fqm]='Y';
					continue;
				}
			}
			flag=true;
		}
	}
	if(flag)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;

	return 0;
}

#include <algorithm>
#include <vector>
#include <iostream>
#include <map>
#include <fstream>
#include <set>
#include <queue>
#include <cmath>
#define all(x) x.begin(), x.end()

using namespace std;
typedef long long ll;

int main() {
	cin.tie(0), cout.tie(0), ios_base::sync_with_stdio(0);
	string s;
	int n, k;
	cin >> n >> k >> s;
	s = s + '8';
	vector<int>pr(s.size() + 1, 0), pp(s.size() + 1, 0);
	for (int i = s.size() - 2; i >= 0; --i) {
		if (s[i] == 'N')pp[i] = pp[i + 1] + 1;
		if (s[i] != 'Y')pr[i] = pr[i + 1] + 1;
		//cout << i << ": \n";
		//cout << "chain: " << pr[i] << "\n";
		//cout << "have n: " << pp[i] << "\n";
	}
	bool ok = 0;
	for (int i = 0; i < s.size(); ++i) {
		if (pr[i] >= k && s[i + k] != 'N') {
			if (i > 0 && s[i - 1] != 'N' || i == 0) {
				ok = 1;
				//cout << i << " " << pr[i]<<"\n";
			}
		}
	}
	for (int i = 0; i < s.size() - 1; i++) {
		if (pp[i] > k) {
			cout << "NO"; exit(0);
		}
	}
	if (ok)cout << "YES";
	else cout << "NO";
	return 0;
}/*
 12 2 N?N

 12 2 YYYYYN?N

 0 6
 N??NN?NNY

 0 7
 N??NN??NY

 */

//I read the news today, oh boy
//About a lucky man who made the grade

#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz(x) int((x).size())
#define all(v) (v).begin(),(v).end()
#define trace(x) cerr << #x << " = " << x << endl
#define fastio ios_base::sync_with_stdio(0);cin.tie(0)
#define For(i,a,b) for(int i = int(a); i < int(b); ++i)
#define roF(i,a,b) for(int i = int(a); i >= int(b); i--)
using namespace std;

typedef long long ll;
typedef pair<int,int> ii;

int dp[1000];
int here[1000][1000];

int solve(string s){
	memset(dp,0,sizeof(dp));
	dp[0]=(s[0]=='N');
	For(i,1,sz(s)){
		if(s[i]!='N')dp[i]=0;
		else dp[i]=dp[i-1]+1;
	}
	int mx=0;
	For(i,0,sz(s))mx=max(mx,dp[i]);
	return mx;
}

int main(){
	fastio;
	int n,k;cin>>n>>k;
	string s;cin>>s;
	int mn=solve(s);
	if(k<mn){
		cout<<"NO"<<endl;
		return 0;
	}
	if(k==0){
		cout<<"YES"<<endl;
		return 0;
	}
	bool find=false;
	s.pb('Y');
	For(i,0,n)For(tam,1,i+2){
		if(s[i+1]=='N')continue;
		here[i][tam]=true;
		For(j,i-tam+1,i+1)if(s[j]=='Y')
			here[i][tam]=false;
		//if(i==11&&tam==7)trace(here[i][tam]);
		if(i-tam>=0&&s[i-tam]=='N')here[i][tam]=false;
		if(tam==k&&here[i][tam])find=true;
	}
	if(find)cout<<"YES"<<endl;
	else cout<<"NO"<<endl;

	return 0;
}

//#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <vector>
#include <deque>
#include <stack>
#include <fstream>
#include <cmath>
#include <cassert>
using namespace std;

#define MOD 1000000007

vector<uint64_t> factors(uint64_t x) {
    set<uint64_t> fac;
    vector<uint64_t> space;
    for (uint64_t i = 1; i <= uint64_t(sqrt(x)); i++) {
        if (x % i == 0) {
            fac.insert(x / i);
            fac.insert(i);
        }
    }

    for (auto& y : fac) {
        space.push_back(y);
    }
    return space;
}

int main() {
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	uint64_t n, k;
	cin >> n>> k;
    string s;
    cin >> s;
    int maxi = 0;
    int curr = 0;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == 'N') {
            curr++;
        }
        else {
            maxi = max(maxi, curr);
            curr = 0;
        }
    }
    maxi = max(maxi, curr);
    if (maxi > k) {
        cout << "NO" << endl;
        return 0;
    }
    else {
        if (maxi == k) {
            cout << "YES" << endl;
            return 0;
        }
        else {
            for (int i = 0; i <= s.size()-k; i++) {
                bool valid = true;
                if (i > 0 && s[i - 1] == 'N') continue;
                for (int j = 0; j < k; j++) {
                    if (s[i + j] == 'Y') {
                        valid = false;
                        break;
                    }
                }
                if (valid) {
                    if (i+k==s.size() || (i + k < s.size() && s[i + k] != 'N')) {
                        cout << "YES" << endl;
                        return 0;
                    }
                }
            }
            cout << "NO" << endl;
            return 0;
        }
    }

	return 0;
}

//Author - Rahil Malhotra
#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl "\n"

int n,k;
string s;
int cache[101][105];
int dp(int pos,int tk)
{
    if(tk>k)
        return -1e18;
    if(pos==n)
        return tk==k;
    int ans=tk==k;
    if(cache[pos][tk]!=-1)
        return cache[pos][tk];
    if(s[pos]!='?')
        return cache[pos][tk]=ans+dp(pos+1,(s[pos]=='N')?tk+1:0);
    return cache[pos][tk]=ans+max(dp(pos+1,tk+1),dp(pos+1,0));
}
int32_t main()
{
    IOS;
    cin>>n>>k>>s;
    memset(cache,-1,sizeof(cache));
    cout<<((dp(0,0)>0)?"YES":"NO");
}

//Author - Rahil Malhotra
#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl "\n"

int n,k;
string s;
int cache[101][105][105];
int dp(int pos,int tk,int maxi)
{
    if(pos==n)
        return maxi==k;

    if(maxi>k)maxi=k+1;
    if(tk>k)tk=k+1;
    if(cache[pos][tk][maxi]!=-1)
        return cache[pos][tk][maxi];
    if(s[pos]!='?')
        return cache[pos][tk][maxi]=dp(pos+1,(s[pos]=='N')?tk+1:0,max(maxi,s[pos]=='N'?tk+1:0));
    return cache[pos][tk][maxi]=max(dp(pos+1,tk+1,max(maxi,tk+1)),dp(pos+1,0,maxi));
}
int32_t main()
{
    IOS;
    cin>>n>>k>>s;
    memset(cache,-1,sizeof(cache));
    cout<<((dp(0,0,0)>0)?"YES":"NO");
}

#include <bits/stdc++.h>
using namespace std;

const int N = 105;

char s[N];

bool dp[N][N][2];

bool solveDp(int ind,int cons,int g,int n,int k) {
    if(cons>k) {
        return false;
    }
    if(ind==n) {
        if(g) {
            return true;
        }
        else {
            return false;
        }
    }
    if(dp[ind][cons][g]) {
        return false;
    }
    dp[ind][cons][g] = true;
    if(s[ind]=='?') {
        int tmp = 0;
        int ng = g;
        if(tmp==k) {
            ng = 1;
        }
        if(solveDp(ind+1,tmp,ng,n,k) ){
            return true;
        }
        tmp = cons+1;
        ng = g;
        if(tmp==k) {
            ng = 1;
        }
        if(solveDp(ind+1,tmp,ng,n,k) ){
            return true;
        }
    }
    else if(s[ind]=='Y') {
        int tmp = 0;
        int ng = g;
        if(solveDp(ind+1,tmp,ng,n,k) ) {
            return true;
        }
    } else {
        int tmp = cons+1;
        int ng = g;
        if(tmp==k) {
            ng = 1;
        }
        if(solveDp(ind+1,tmp,ng,n,k) ) {
            return true;
        }
    }
    return false;
}

void solve() {
    int n,k;
    scanf("%d %d",&n,&k);
    scanf("%s",s);
    int g = 0;
    if(k==0) {
        g = 1;
    }
    if(solveDp(0,0,g,n,k)) {
        cout<<"YES\n";
    } else {
        cout<<"NO\n";
    }
}

int main()
{
    solve();
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <ctime>
#include <cmath>
#include <string>
#include <stdlib.h>
#include <fstream>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <iterator>
#include <iomanip>
#include <climits>
#include <numeric>
#include <cstring>
#include <list>
using namespace std;
#define ll long long int

const int MAXN = 2e5 + 1;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n, k;
    string s;
    cin >> n >> k >> s;

    int cnt = 0, a = 0;

    for(int i = 0; i < n; ++i){
        if(s[i] == 'N'){
            if(i && s[i - 1] == 'N') cnt++;
            else cnt = 1;
        }
        if(s[i] != 'N') cnt = 0;

        a = max(a, cnt);
    }

    if(a > k){
        cout << "NO\n";
        return 0;
    }

    if(a == k){
        cout << "YES\n";
        return 0;
    }

    for(int i = 0; i <= n - k; ++i){
        bool ok = true;

        if(i && s[i - 1] == 'N') continue;
        if(i + k != n && s[i + k] == 'N') continue;

        for(int j = i; j < i + k; ++j){
            if(s[j] == 'Y'){
                ok = false;
                break;
            }
        }

        if(ok){
            cout << "YES\n";
            return 0;
        }
    }

    cout << "NO\n";
}

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main(){

    //Stepan's Series

    int i, n, k, prev, now, ans;
    string s;

    cin>>n>>k;
    cin>>s;

    prev=0;
    ans=0;

    for (i=0;i<n;i++){
        if (s[i]=='N'){
            now=prev+1;
        }
        else {
            now=0;
        }
        prev=now;
        ans=max(ans, now);
    }

    if (ans==k){
        cout<<"YES\n";
    }
    else if (ans<k){
        int j;
        bool b=true;
        vector <int> v;
        for (i=0;i<n;i++){
            if (s[i]=='Y'){
                v.push_back(i);
                b=true;
            }
            else if (s[i]=='?'){
                if (i>0){
                    if (s[i-1]!='N'){
                        v.push_back(i);
                    }
                }
                else {
                    v.push_back(i);
                }
                b=true;
            }
            else {
                if (b){
                    v.push_back(i);
                    b=false;
                }
            }
        }
        for (i=0;i<v.size();i++){
            prev=0;
            ans=0;
            for (j=v[i];j<n;j++){
                if (s[j]=='N'){
                    now=prev+1;
                }
                else if (s[j]=='?'){
                    if (ans<k){
                        now=prev+1;
                    }
                    else {
                        now=0;
                    }
                }
                else {
                    now=0;
                }
                prev=now;
                ans=max(ans, now);
            }
            if (ans==k){
                break;
            }
        }
        if (ans==k){
            cout<<"YES\n";
        }
        else {
            cout<<"NO\n";
        }
    }
    else {
        cout<<"NO\n";
    }

    return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <iterator>
#include <sstream>
#include <set>
#include <map>
#include <unordered_map>
#include <list>
#include <ctime>
#include <queue>
#include <cmath>
#include <stack>
#include <functional>
#include <memory>
#include <tuple>
#include <utility>

using namespace std;

#define __int64 long long
const double pi = atan2(0.0, -1.0);
const int inf = 2147483647;

//For working whith file in my PC
#ifdef RED
//#include "acm.h"
//#include "Test.h"
ifstream in;
ofstream out;
#define cin in
#define cout out
#endif
// cout << fixed << setprecision(a) <<

class Global // For zeroing fields in unit test
{
public:

	int n, i, k;
	string s;
	bool yes = false;
	char ch;
	void solve()
	{
		cin >> n >> k >> s;
		vector<vector<int>> v(n+2);
		s += 'Y';
		v[0] = { 0};

		for (i = 1; i<=n+1;i++)
		{
			ch = s[i-1];
			if (ch == 'Y')
			{
				if (v[i - 1][0] > k)
				{
					cout << "NO";
					return;
				}
				for (const auto& it : v[i - 1])
				{
					if (it == k) yes = true;
				}
				v[i] = { 0 };
			}
			if (ch == 'N')
			{
				v[i] = v[i - 1];
				for (auto& it : v[i])
				{
					++it;
				}
			}
			if (ch == '?')
			{
				v[i] = { 0 };
				for (auto& it : v[i-1])
				{
					v[i].push_back(it + 1);
				}
				for (const auto& it : v[i - 1])
				{
					if (it == k) yes = true;
				}
			}
		}

		if (yes)
		{
			cout << "YES";
		}
		else
		{
			cout << "NO";
		}
	}

};

#ifndef UNIT_TESTING

int main()
{
	//srand(time(0));
	//ios_base::sync_with_stdio(0);
	//cin.tie(0);

#ifdef RED

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	in.open("input.txt");
	out.open("output.txt");

	int amount_TEST = 1;
	cin >> amount_TEST;
	for (int amount_test = 1; amount_test <= amount_TEST; ++amount_test)
	{
#endif

		vector<Global> global;

		int t = 1;
		//	cin >> t;
			//		easy_factory();
		for (; t--;)
		{
			global.clear();
			global.resize(1);
			global[0].solve();
		}

#ifdef RED
		cout << "\nКонец " << amount_test << " Теста\n";
	}
#endif
}
#endif UNIT_TESTING

#include <iostream>
#include <string>

using namespace std;

int main()
{
	string s;
	short n, k, a = 0, max = 0, maxnow = 0, min = 0, minnow = 0, f = 1, b;
	cin >> n >> k >> s;
	for (; a < n; a++)
	{
		if (s[a] != 'Y') { maxnow++; if (max < maxnow) max++; }
		else maxnow = 0;
		if (s[a] == 'N') { minnow++; if (min < minnow) min++; }
		else minnow = 0;
	}
	if ((k < min) | (k > max)) { cout << "NO"; return 0; }
	if ((k == min) | (k == max)) { cout << "YES"; return 0; }
	for (a = 0; a < k; a++)
	{
		if (s[a] == 'Y') { f = 0; break; }
	}
	if (f & (s[a] != 'N')) { cout << "YES"; return 0; }
	n -= k;
	f = 1;
	for (a = 1; a < n; a++)
	{
		for (b = a; b < a + k; b++)
		{
			if (s[b] == 'Y') { f = 0; break; }
		}
		if (f & (s[a - 1] != 'N') & (s[b] != 'N')) { cout << "YES"; return 0; }
		else f = 1;
	}
	f = 1;
	for (a = n; a < n + k; a++)
	{
		if (s[a] == 'Y') { f = 0; break; }
	}
	if (f & (s[n - 1] != 'N')) { cout << "YES"; return 0; }
	else cout << "NO";
	return 0;
}

#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define inf 0x3f3f3f3f
char a[250];
int main()
{
    int n,k;
    scanf("%d%d",&n,&k);
    getchar();
    for(int i=1; i<=n; i++)
    {
        scanf("%c",&a[i]);
    }
    // printf("%s",a);
    int p=1,kk,maxx=0,flag=0,kkk,sum=0;
    for(int i=1; i<=n; i+=p)
    {
        //printf("i=%d\n",i);
        if(a[i]=='N')
        {
            kk=0;
            for(int j=i; j<=n; j++)
            {
                if(a[j]=='N')
                {
                    kk++;
                }
                else
                {
                    p=kk;
                    break;
                }
            }
            maxx=max(maxx,kk);
            kkk=kk;
            //  printf("%d\n",kk);
            if(kk<k)
            {
                for(int j=i-1; j>=1; j--)
                {
                    if((a[j]=='?'&&j==1)||(a[j]=='?'&&a[j-1]!='N'))
                    {
                        if(kk>=k)
                        {
                            if(kk==k)
                            {
                                flag=1;
                            }
                            break;
                        }
                        kk++;
                        if(kk>=k)
                        {
                            if(kk==k)
                            {
                                flag=1;
                            }
                            break;
                        }
                    }
                    else if(a[j]=='?'&&a[j-1]=='N')
                    {
                        if(kk>=k)
                        {
                            if(kk==k)
                            {
                                flag=1;
                            }
                            break;
                        }
                        kk++;
                    }
                    else if(a[j]=='N')
                        kk++;
                    else if(a[j]=='Y')
                    {
                        break;
                    }
                }
                if(flag==0)
                {
                    for(int j=i+p; j<=n; j++)
                    {
                        if((a[j]=='?'&&j==n)||(a[j]=='?'&&a[j+1]!='N'))
                        {
                            if(kkk>=k)
                            {
                                if(kkk==k)
                                {
                                    flag=1;
                                }
                                break;
                            }
                            kkk++;
                            if(kkk>=k)
                            {
                                if(kkk==k)
                                {
                                    flag=1;
                                }
                                break;
                            }
                        }
                        else if(a[j]=='?'&&a[j+1]=='N')
                        {
                            if(kkk>=k)
                            {
                                if(kkk==k)
                                {
                                    flag=1;
                                }
                                break;
                            }
                            kkk++;
                        }
                        else if(a[j]=='N')
                            kkk++;
                        else if(a[j]=='Y')
                        {
                            break;
                        }
                    }
                }

            }
            //   printf("%d %d %d\n",i,kk,kkk);

            //  maxx=max(maxx,kkk);
        }
        else
        {
            p=1;
        }
    }
    if(flag==0)
    {
        int pos=1;
        for(int i=n; i>=1; i--)
        {
            if(a[i]=='N')
            {
                pos=i+2;
                break;
            }
        }
        kk=0;
       // printf("%d\n",pos);
        for(int i=pos; i<=n; i++)
        {
            if(a[i]=='?')
            {
                if(kk==k)
                {
                    flag=1;
                    break;
                }
                kk++;
                if(kk==k)
                {
                    flag=1;
                    break;
                }
            }
            else
            {
                kk=0;
            }
        }
    }

    // printf("%d\n",flag);
    if(maxx==k||(maxx<k&&flag))
        printf("YES\n");
    else printf("NO\n");
}

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#define MIN 1<<31-1
#define REP(i,n) for(int i = 0; i < (n); i++)
typedef long long int ll;
char NN[10000];
int zu[10000];
using namespace std;
int main()
{
	int n,k,l,r;
	cin>>n>>k;
	l=0;r=0;
	int flag=0;
	int nowl=0;
	int cou=0;
	for(int i=0;i<n;i++)
	{
		cin>>NN[i];
	}
	int i;
	for(i=0;i<n;i++)
	{
		if((NN[i]=='N'||NN[i]=='?')&&NN[i-1]!='N')
		{
			int w;
			for(w=1;w<k;w++)
				if(w+i>=n||NN[w+i]=='Y')
					break;
			if(w==k&&NN[i+w]!='N')
			{
				break;
			}
		}
	}
	int out=0;
	if(i!=n||k==0)
		out=1;
	int mi=0;
	int nmi=0;
	for(i=0;i<n;i++)
	{
		if(NN[i]=='N')
		{
			nmi++;
		}
		else
		{
			mi=max(mi,nmi);
			nmi=0;
		}
	}
	mi=max(mi,nmi);
	if(out==1&&mi<=k)
		cout<<"YES";
	else
		cout<<"NO";
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int dp[101][101][101], n, k;
string s;
int solve(int i, int N, int mx){
	if (i == n)
		return mx == k ? 1 : 0;
	int &ret = dp[i][N][mx];
	if (~ret)return ret;
	if (s[i] == 'N'){
		mx = max(mx, N + 1);
		return ret = solve(i + 1, N + 1, mx);
	}
	if (s[i] == 'Y'){
		mx = max(mx, N);
		return ret = solve(i + 1, 0, mx);
	}
	int c1 = solve(i + 1, 0, max(mx, N));
	int c2 = solve(i + 1, N + 1, max(mx, N + 1));
	return ret = max(c1,c2);
}
int main(){
	memset(dp, -1, sizeof dp);
	cin >> n >> k >> s;
	cout << (solve(0, 0, 0) ? "YES" : "NO");
}

#include <bits/stdc++.h>
#define mod 1000000007
#define INF 1000000000000000007LL
#define SZ 200009
#define ull unsigned long long
#define ll long long int
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define all(v) ((v).begin()), ((v).end())
#define ios ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__)
#define dbvv(v) cout << "Printing "#v << " --> \n"; for(ll i=0;i<v.size();i++) {for(ll j=0;j<v[i].size();j++) cout << v[i][j] << " "; cout << "\n";}
#define dbv(st) cout << "Printing "#st << " --> \n"; for(auto i=st.begin();i!=st.end();i++) cout << *i << " "; cout << "\n";
#define dbvp(st) cout << "Printing "#st << " --> \n"; for(auto i=st.begin();i!=st.end();i++) cout << i->first << " " << i->second << "\n"; cout << "\n";
#define dbmp(mp) cout << "Printing "#mp << " --> \n"; for(auto i=mp.begin();i!=mp.end();i++) cout << #mp"[" << i->first << "]"<< " = " << i->second << "\n";
#define dbar(ar,st,en) cout << "Printing "#ar << " --> \n"; for(auto it=st;it!=en;it++) cout << *it << " "; cout << "\n";
#define dbmar(ar,rowz,colz) cout << "Printing "#ar << " --> \n"; for(auto i=0;i<rowz;i++) {for(auto j=0;j<colz;j++) cout << ar[i][j] << " "; cout << "\n";}
template <typename Arg1>void ZZ(const char* name, Arg1&& arg1){std::cout << name << " = " << arg1 << std::endl;}
template <typename Arg1, typename... Args>void ZZ(const char* names, Arg1&& arg1, Args&&... args)
{
    const char* comma = strchr(names + 1, ',');
    std::cout.write(names, comma - names) << " = " << arg1;
    ZZ(comma, args...);
}
using namespace std;

ll to_ll(string &s)
{
	ll i,ret=0,p=1;
	for(i=(ll)s.length()-1;i>=0;i--) ret+=(s[i]-'0')*p, p*=10LL;
	return ret;
}
ll gcd(ll x,ll y)
{
	if(y==0) return x;
	return gcd(y,x%y);
}
ll pwr(ll base,ll expo,ll m)
{
	if(base==0) return 0LL;
	if(expo==0) return (1LL%m);
	if((expo&1)==0) {ll temp=pwr(base,expo>>1,m); return (temp*temp)%m;}
	return ((base%m)*pwr(base,expo-1,m))%mod;
}
ll n,k;
string s;
ll chk(string &x)
{
	//db(x);
	ll mx=0;
	ll i,j;
	for(i=0;i<n;i++)
	{
		ll cnt=0;
		for(j=i;j<n;j++)
		{
			if(x[j]!='N') break;
			cnt++;
		}
		mx=max(mx,cnt);
	}
	return mx;
}
int main()
{
	ios;
	cin>>n>>k;
	cin>>s;
	if(k==0)
	{
		if(s=="Y"||s=="?") cout << "YES\n";
		else cout << "NO\n";
		return 0;
	}
	ll i,j,it;
	for(i=0;i<n;i++)
	{
		for(j=i;j<n;j++)
		{
			if(j-i+1!=k) continue;
			ll cnt=count(s.begin()+i,s.begin()+j+1,'Y');
			if(cnt>0) continue;
			string cpy=s;
			for(it=j+1;it<n;it++) if(cpy[it]=='?') cpy[it]='Y';
			for(it=i-1;it>=0;it--) if(cpy[it]=='?') cpy[it]='Y';
			for(it=i;it<=j;it++) if(cpy[it]=='?') cpy[it]='N';
			if(chk(cpy)!=k) continue;
			cout << "YES\n";
			return 0;
		}
	}
	cout << "NO\n";
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main(){
	int n , k;
	cin >> n >> k;
	char s [n];
	cin >> s;
	bool f=false;

	for(int i=0;i<sizeof(s);i++){
		char t [n];
		for(int j=0;j<sizeof(s);j++){
			if(j>=i && j<i+k && s[j]=='?')
				t[j]='N';
			else
				t[j]=s[j];
		}
		int m=0;
		int cnt=0;
		for(int j=0;j<sizeof(s);j++){
			if(t[j]=='N')
				cnt++;
			else
				cnt=0;
			m=max(m,cnt);
		}
		if(m==k)
			f=true;
	}

	cout << (f? "YES" : "NO");
 	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int n, m;
string s;

int main()
{
  cin >> n >> m;
  cin >> s;
  for(int i = 0;i < n-m+1;i++){
    if(i >= 1 && s[i-1] == 'N')continue;
    if(i+m < n && s[i+m] == 'N')continue;

    int ok = 1;
    for(int j = 0;j < m;j++){
      if(s[i+j] == 'Y'){
        ok = 0;
      }
    }
    int rep = 0;
    for(int j = 0;j < i;j++){
      if(s[j] == 'N'){
        if(++rep > m){
          ok = 0;
        }
      }else{
        rep = 0;
      }
    }
    rep = 0;
    for(int j = i+m;j < n;j++){
      if(s[j] == 'N'){
        if(++rep > m){
          ok = 0;
        }
      }else{
        rep = 0;
      }
    }
    if(ok){
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}

#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
int n, k;
string s;
int dp[105][105][105];
int solve(int ind, int cnt, int mx){
	mx = max(mx, cnt);
	if (ind == n)
		return mx == k;
	int & ret = dp[ind][cnt][mx];
	if (ret != -1)
		return ret;
	if (s[ind] == 'Y')
		ret = solve(ind + 1, 0, mx);
	else if (s[ind] == 'N')
		ret = solve(ind + 1, cnt + 1, mx);
	else
		ret = solve(ind + 1, cnt + 1, mx) || solve(ind + 1, 0, mx);
	return ret;
}
int main()
{
	cin >> n >> k >> s;
	memset(dp, -1, sizeof dp);
	if (solve(0, 0, 0))
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
	return 0;
}

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
	int n, k;
	string s;
	cin >> n >> k >> s;

	s = string("Y") + s + string("Y");

	int i, j, ok, found, longest, run;

	longest = 0;
	found = 0;
	run = 0;

	for (i=1; i<=n; i++) {
		if (s[i] == 'N') {
			run += 1;
		} else {
			run = 0;
		}
		if (run > longest) {
			longest = run;
		}
	}

	for (i=1; i<=n-k+1; i++) {
		ok = 1;
		for (j=i; j<i+k; j++) {
			if (s[j] == 'Y') {
				ok = 0;
			}
		}
		if (s[i-1] == 'N') {
			ok = 0;
		}
		if (s[i+k] == 'N') {
			ok = 0;
		}

		if (ok) {
			found = 1;
		}
	}

	cerr << longest << '\n';

	if (found && k >= longest) {
		cout << "YES";
	} else {
		cout << "NO";
	}
}

#include<bits/stdc++.h>
#define LL int64_t
#define LD long double;
using namespace std;

bool can(string s, int n, int k, int pos) {
    for(int i=0;i<k;i++) {
        if(s[pos+i]=='?') s[pos+i]='N';
    }
    for(int i=0;i<n;i++) if(s[i]=='?') s[i]='Y';

    int maxStreak = 0;
    int curStreak = 0;
    for(char c : s) {
        if(c=='Y') curStreak = 0;
        else curStreak++;
        maxStreak=max(maxStreak,curStreak);
    }
    return maxStreak == k;
}

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int n,k;
    string s;
    cin>>n>>k>>s;

    bool ans = false;
    for(int i=0;i<n-k+1;i++) {
        if(can(s,n,k,i)) ans = true;
    }
    if(ans) cout<<"YES\n";
    else cout<<"NO\n";
}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef complex<double> cplx;

#define sqr(x) ((x)*(x))
#define pb push_back
#define X first
#define Y second
#define sit(a) set<a>::iterator
#define mit(a,b) map<a,b>::iterator

const ll mod=1000000007LL;
const int inf=0x3f3f3f3f;
const int maxn=500005,maxm=10005;
const double eps=1e-10;
const double pi=acos(-1.0);

char c[maxn];
int n,k;
bool v[maxn]={0};

bool check()
{
    int i,j;
    for(i=0;i<n;i++)
    {
        for(j=i;j<i+k&&j<n&&c[j]=='N';j++);
        if(j<n&&j==i+k&&c[j]=='N') return 0;
    }
    return 1;
}

void solve()
{
    int i,j;
    for(i=0;i+k<=n;i++)
    {
        for(j=i;j<i+k&&c[j]!='Y';j++) c[j]='N';
        if(j==i+k&&check()) {printf("YES\n");return;}
        for(j=i;j<i+k&&v[j];j++) c[j]='?';
    }
    printf("NO\n");
}

int main()
{
    int i,j;
    scanf("%d %d %s",&n,&k,c);
    for(i=0;i<n;i++) if(c[i]=='?') v[i]=1;
    solve();
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int N = 200;

char s[N];
int n, k;
int main() {
  scanf("%d %d", &n, &k);
  scanf("%s", s);
  bool ok = 1, exact = 0;

  for (int i = 0; i < n; i++) {
    if (i + k + 1 > n) break;
    bool now = 0;
    for (int j = 0; j < k+1; j++) {
      if (s[i+j] != 'N')
        now = 1;
    }
    if (!now) {
      puts("NO");
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    if (i + k > n) break;
    bool now = 1;
    if (i && s[i-1] == 'N') now = 0;
    if (i + k < n && s[i+k] == 'N') now = 0;
    for (int j = 0; j < k; j++)
      if (s[i+j] == 'Y')
        now = 0;
    if (now)
      exact = 1;
  }
  if (exact)
    puts("YES");
  else
    puts("NO");
  return 0;
}

#include <iostream>
#include <stdio.h>
#include <cmath>
#include <math.h>
#include <string>
#include <algorithm>
#include <functional>
#include <stack>
#include <list>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <sstream>
#include <cassert>

#define PI 3.1415926535
#define ll long long
#define ull unsigned long long
#define umap unordered_map
#define uset unordered_set
#define all(a) a.begin(), a.end()
#pragma comment(linker, "/STACK:64777216")

using namespace std;

const int MAXINT = (int)2e9 + 100;
const ll MAXN = 100000;
const ll MAXVAL = 10000000;
const ll INF = (ll)1e18 + 50;
const ll MOD = (ll)1e9 + 7;
const ull HASH_MOD = 2305843009213693951;
string failMessage;

void fail()
{
	cout << failMessage;
	exit(0);
};

int f(string s)
{
	s += "Y";

	int max_len = -1, cur = 0;

	for (int i = 0; i < s.length(); i++)
	{
		if (s[i] != 'N')
		{
			max_len = max(max_len, cur);
			cur = 0;
		}
		else if (s[i] == 'N')
		{
			cur++;
		}
	}

	return max_len;
}

void solve()
{
	int n, k;
	cin >> n >> k;
	string s;
	cin >> s;

	int l = f(s);

	if (l > k)
	{
		cout << "NO";
		return;
	}

	for (int i = 0; i < n; i++)
	{
		bool good = true;
		if (i + k - 1 >= n)
			break;
		if (i > 0 && s[i - 1] == 'N')
			good = false;
		if (i + k < n && s[i + k] == 'N')
			good = false;
		for (int j = i; j < i + k; j++)
		{
			if (s[j] == 'Y')
				good = false;
		}

		if (good)
		{
			cout << "YES";
			return;
		}
	}

	cout << "NO";
}

int main()
{
	const string FILENAME = "111";
#ifndef LOCAL
	//freopen((FILENAME + ".in").data(), "r", stdin);
	//freopen((FILENAME + ".out").data(), "w", stdout);
#endif // !LOCAL

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.precision(15);
	solve();

}

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>

using namespace std;
typedef long long LL;
const LL INF=1e17L;
const int inf=0x3f3f3f3f;
const int maxn=1e2+5;
const int Mod=1e9+7;
int dp[maxn][maxn][maxn],n,k;
string s;
int main()
{
    cin>>n>>k>>s;
    dp[0][0][0]=1;
    for(int i=1;i<=n;i++)
    {
        char c=s[i-1];
        for(int j=0;j<=k;j++)
        {
            for(int d=0;d<=j;d++)
            {
                if(dp[i-1][j][d])
                {
                    if(c=='Y')
                    {
                        dp[i][j][0]=1;
                    }
                    else if(c=='N')
                    {
                        dp[i][max(j,d+1)][d+1]=1;
                    }
                    else
                    {
                        dp[i][max(j,d+1)][d+1]=1;
                        dp[i][j][0]=1;
                    }
                }
            }
        }
    }
    bool flag=false;
    for(int i=0;i<=k;i++)
        if(dp[n][k][i]) flag=true;
    if(flag) puts("YES");else puts("NO");
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int MAXN = 2e5 + 5;
const long long MOD = 1e9 + 7;

pair<int,int> p;

int main()
{
	//freopen("input.in","r",stdin);
    //freopen("output.out","w",stdout);

	int n,k; cin >> n >> k;
	string s; cin >> s;
	int c1 = 0; int c2 = 0;
	for(int i = 0; i < n;)
	{
		if(s[i] == 'N')
		{
			int j = i;
			while(j < n && s[j] == 'N')
				j++;
			c1 = max(c1,j - i);
			i = j;
		}
		else
		{
			i++;
		}
	}
	for(int i = 0; i < n;)
	{
		if(s[i] == 'N' || s[i] == '?')
		{
			int j = i;
			while(j < n && (s[j] == 'N' || s[j] == '?'))
				j++;
			c2 = max(c2,j - i);
			i = j;
		}
		else
		{
			i++;
		}
	}
	if(c1 > k || c2 < k){
		cout << "NO";
		return 0;
	}
	if(k == 0){
		if(c1 == 0)
		{
			cout << "YES";
			return 0;
		}
	}
	for(int i = 0; i < n; ++i)
	{
		for(int j = i; j < n; ++j)
		{
			if(j - i + 1 !=  k) continue;
			else
			{
				int c = 0;
				for(int l = i; l <= j; ++l)
				{
					if(s[l] == '?' || s[l] == 'N')
						c++;
				}
				if(c == k){
					int fl = 1;
					if(i - 1 >= 0 && s[i - 1] == 'N') fl = 0;
					if(j + 1 < n && s[j + 1] == 'N') fl = 0;
					if(fl)
					{
						cout << "YES\n";
						return 0;
					}
				}
			}
		}
	}
	cout << "NO";

	return 0;

}

#include <bits/stdc++.h>
#define maxn 200
using namespace std;

int n, m;
char a[maxn];

int main()
{
	scanf("%d%d", &n, &m);
	scanf("%s", a + 1);

	if(m == 0)  //特判
	{
		for(int i = 1; i <= n; ++i)
		{
			if(a[i] == 'N')
			{
				printf("NO\n");
				return 0;
			}
		}
		printf("YES\n");
		return 0;
	}
	if(m == n)
	{
		for(int i = 1; i <= n; ++i)
		{
			if(a[i] == 'Y')
			{
				printf("NO");
				return 0;
			}
		}
		printf("YES");
		return 0;
	}

	int cnt = 0, ansn = 0;
	for(int i = 1; i <= n; ++i)
	{
		if(a[i] == 'N')
		{
			cnt++;
		}
		else
		{
			cnt = 0;
		}

		ansn = max(ansn, cnt);
	}

	if(ansn > m)
	{
		printf("NO");
		return 0;
	}
	if(ansn == m)
	{
		printf("YES");
		return 0;
	}

	//针对？的情况
	for(int i = 1; i <= n; ++i)
	{
		if(a[i] == 'Y')
			continue;
		if(i + m > n + 1)
			break;

		bool ok = true; //一开始认为是好的
		for(int k = i; k <= i + m - 1; ++k)
		{
			if(a[k] == 'Y') //判断是否是好的
			{
				ok = false;
				break;
			}
		}
		if(ok && a[i + m] != 'N' && a[i - 1] != 'N')
		{
			printf("YES");
			return 0;
		}
	 }
	 printf("NO");

	return 0;
}

#include <iostream>
#include <vector>

using namespace std;

int main() {
    int n, k;
    cin >> n >> k;
    char c;
    int cnt1 = 0, cnt2 = 0;
    int cur1 = 0, cur2 = 0;
    vector<char> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for (int i = 0; i < n; i++) {
        c = a[i];
        if (c == '?') {
            cur1++;
            cur2 = 0;
        }
        else if (c == 'N') {
            cur2++;
            cur1++;
        }
        else if (c == 'Y') {
            cur2 = 0;
            cur1 = 0;
        }
        if (cur1 >= k) {
            if ((i == n - 1 || a[i + 1] != 'N') && (i - k == -1 || a[i - k] != 'N')) {
                cnt1 = cur1;
            }
        } else {
            cnt1 = max(cnt1, cur1);
        }
        //cout << cnt1 << '\n';
        cnt2 = max(cnt2, cur2);
    }
    //cout << cnt1 << ' ' << cnt2 << '\n';
    if (cnt1 >= k && cnt2 <= k) {
        cout << "YES\n";
    } else {
        cout << "NO\n";
    }
}

#include<bits/stdc++.h>
#define FileName      "test"
#define ll            long long
#define ld            long double
#define ull           unsigned long long
#define Debug(x)      cerr << #x << "is " << x << '\n';
#define pb            emplace_back
#define mp            make_pair
#define x             first
#define y             second
//#define LuckyAurora
//#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")

using namespace std;

template<typename T> inline void Cin(T &x)
{
    char c;
    T sign = 1;
    x = 0;
    for (c = getchar(); c < '0' || c > '9'; c = getchar())
        if (c == '-') sign = -1;
    for (; c >= '0' && c <= '9'; c = getchar())
        x = x * 10 + c - '0';
    x *= sign;
}
template <typename T> inline void Out(T x) {if(x > 9) Out(x / 10); putchar(x % 10 + '0');}
template <typename T> inline void Cout(T x, char c) {if(x < 0) putchar('-'); x = abs(x); Out(x); putchar(c);}
template <typename T, typename... Args> inline void Cin(T& a, Args&... args) {Cin(a);Cin(args...);}
template <typename T, typename... Args> inline void Cout(T a, char c, Args... args) {Cout(a, c);Cout(args...);}

typedef pair<ll, ll> Point;
const int N = int(2e5) + 3;

int n, k, cnt;
bool can;
string s;

bool Check(int l, int r)
{
    if(r > n) return 0;
    for(int i = l; i <= r; ++i)
       if(s[i] == 'Y') return 0;
    if(s[l - 1] == 'N' || s[r + 1] == 'N') return 0;
    return 1;
}

void Enter()
{
     cin >> n >> k >> s;
     s = ' ' + s + ' ';
     for(int i = 1; i <= n; ++i) {
        if(Check(i, i + k - 1)) can = 1;
        if(s[i] == 'N') ++cnt;
        else cnt = 0;
        if(cnt > k) {cout << "NO"; exit(0);}
     }
     if(can) cout << "YES\n";
     else cout << "NO\n";
}

void Solve()
{

}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    if(fopen(FileName".inp", "r")) {
        freopen(FileName".inp", "r", stdin);
        freopen(FileName".out", "w", stdout);
    }

    /*int nTest; cin >> nTest;
    while(nTest --)*/ Enter(), Solve();

    return 0;
}

//
//  main.cpp
//  test
//
//  Created by Максим Бачурин on 04.02.17.
//  Copyright © 2017 Максим Бачурин. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
#include <set>
#include <map>
#include <list>
#include <queue>
#include <algorithm>
#include <iomanip>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> PII;
const ll mod = 1e9 + 7;
//const double eps = 1e-9;
const int inf = 1e9;
//const double PI = 3.1415926535897932384626433832795;
const int N = 40005;

int main()
{
    //freopen("output.txt", "r", stdin);
    //freopen("output2.txt", "w", stdout);
    ios_base::sync_with_stdio(0);
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    int t, mx;
    for(int i = 0; i <= s.size() - k; i++)
    {
        mx = 0;
        t = 0;
        for(int j = 0; j < s.size(); j++)
        {
            if(s[j] == 'N' || (s[j] == '?' && i <= j && j < i + k))
            {
                t++;
                mx = max(mx, t);
            }
            else
                t = 0;
        }
        if(mx == k)
            return cout << "YES" << endl, 0;
    }
    cout << "NO" << endl;
    return 0;
}

#include <stdio.h>
#include <bits/stdc++.h>

#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)

#define file ""

using namespace std;
using ll = long long;
using ull = unsigned long long;
using str = string;
using srt = short;

const int INF = (int)1e9 + 7;
const int mod = 998244353;
const ll inf = (ll)1e18;
const ull oo = 1000000000000001;
const int N = 200005;

signed main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	ios::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr); //freopen(file".in", "r", stdin); freopen(file".out", "w", stdout);

	int n, k;
	cin >> n >> k;
	str s;
	cin >> s;
	s = '#' + s + '#';
	int cnt = 0;
	int mx = 0;
	for (int i = 1; i <= n; ++i)
	{
		if (s[i] == 'N')
			++cnt;
		else
			cnt = 0;
		mx = max(mx, cnt);
	}
	if (k < mx || n < k)
	{
		cout << "NO";
	}
	else
	{
		for (int i = 1; i + k - 1 <= n; ++i)
		{
			bool ok = (s[i - 1] != 'N' && s[i + k] != 'N');
			for (int j = i; ok && j <= i + k - 1; ++j)
			{
				ok &= (s[j] != 'Y');
			}
			if (ok)
			{
				cout << "YES";
				return 0;
			}
		}
		cout << "NO";
	}
}

#include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define ll long long
#define pb push_back
//////////////////////////
const int oo = 1e9 + 9;
const ll inf = 1e18 + 18;
const int max6 = 1e6 + 6;
const int modx = 1e9 + 123;
const int mody = 997;
const int base = 137;
typedef pair <int,int> ii;
//////////////////////////

int t[max6];
int n,k;

bool ok(int l,int r)
{
    int cnt = 0;
    for (int i = l; i <= r; ++i)
        cnt += t[i] == 1;

    if (cnt)
        return false;

    int cur = 0;
    for (int i = r+1; i <= n; ++i)
    {
        if (t[i] == 2)
            cur++;
        else cur = 0;
        if (cur > k)
            return false;
    }

    for (int i = 1; i < l; ++i)
    {
        if (t[i] == 2)
            cur++;
        else cur = 0;

        if (cur > k)
            return false;
    }

    return true;
}
//////////////////////////
main()
{
#define file ""
#ifndef ONLINE_JUDGE
    freopen(file"inp","r",stdin);
    freopen(file"out","w",stdout);
#endif // ONLIN

    cin >> n >> k;

    string s;
    cin >> s;

    for (int i = 1; i <= n; ++i)
        if (s[i-1] == 'Y')
            t[i] = 1;
        else if (s[i-1] == 'N')
            t[i] = 2;
        else if (s[i-1] == '?')
            t[i] = 3;

    int res = 0;
    for (int i = 1; i <= n; ++i)
        if (i == 1 || t[i-1] == 1 || t[i-1] == 3)
    {
        int j = i+k-1;
        if (j == n || t[j+1] == 1 || t[j+1] == 3)
            if (ok(i,j))
                res = 1;
    }

    cout<<(res ? "YES" : "NO");
}

#include <bits/stdc++.h>
#define fr(i, n, m) for(int i = (n); i < (m); i ++)
#define pb push_back
#define st first
#define nd second
#define pq priority_queue
#define all(x) begin(x),end(x)

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
ll const inf = 1e9;
ll const mod = 1e9 + 7;
ld const eps = 1e-9;

int main()
{
        int n, k;
        cin >> n >> k;
        string s;
        cin >> s;
        int c = 0;
        int best = 0;
        int cnt[n];
        fr(i, 0, n){
                cnt[i] = 0;
                if(i > 0) cnt[i] = cnt[i - 1];
                if(s[i] == 'N') c ++;
                else{
                        best = max(best, c);
                        c = 0;
                        if(s[i] == 'Y') cnt[i] ++;
                }
        }
        best = max(best, c);
        if(best > k){
                cout << "NO" << endl;
                return 0;
        }
        if(best == k){
                cout << "YES" << endl;
                return 0;
        }
        fr(i, 0, n - k + 1){
                if(i > 0 && s[i - 1] == 'N') continue;
                if(i + k < n && s[i + k] == 'N') continue;
                int p = 0;
                if(i > 0) p = cnt[i - 1];
                if(cnt[i + k - 1] == p){
                        cout << "YES" << endl;
                        return 0;
                }
        }
        cout << "NO"<<endl;
        return 0;
}

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>

#define ll long long
#define pb push_back
using namespace std;

int main() {
	int n,k;
	scanf("%d%d", &n, &k);
	char s[105];
	scanf("%s", &s);
	s[n] = 'Y';
	int t,mx = 0;
	for (int i=0;i<n;++i)
	{
		t = 0;
		while(i<n && s[i]=='N')
		{
			t++;
			i++;
		}
		if (t>k)
		{
			cout<<"NO";
			return 0;
		}
		if (t>mx)
			mx = t;
		if (t!=0)
			i--;
	}
	if (mx==k)
	{
		cout<<"YES";
		return 0;
	}

//	cout<<mx<<endl;

	int j = -1;
	for (int i=0;i<n;++i)
	{
		//cout<<i<<endl;
		t = 0;
		while(s[i]=='?' || s[i]=='N')
		{
			if (s[i]=='?' && j==-1)
				j = i;
			t++;
			i++;
			if (t==k)
			{
				if (s[i]=='N')
					break;
				else
				{
					cout<<"YES";
					return 0;
				}
			}
		}
		if (j!=-1)
		{
			i = j;
			j = -1;
		}
	}
cout<<"NO";
return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <map>
#include <algorithm>
#include <memory.h>

using namespace std;
long long MOD = 1000000007;
string go;
int sost[101][101];
int k;
int din (int pos, int least)
{
	if (sost[pos][least] != -1)
		return sost[pos][least];
	int ma = -1e9;
	if (pos == 0)
	{
		if (least == 1 && (go[0] == 'N' || go[0] == '?'))
			return 1;

		if (least == 0 && go[0] == 'N')
			return -1e9;

		if (least == 0 && (go[0] == 'Y' || go[0] == '?'))
			return 1;
	}
	if (go[pos] == 'N' && least == 0)
		return -1e9;

	if (least == 0 && (go[pos] == '?' || go[pos] == 'Y'))
		ma = max(ma, din(pos - 1, k))+1;

	if (least != 0 && go[pos] == '?')
	{
		ma = max(ma, din(pos - 1, least - 1));
		ma = max(ma, din(pos - 1, k));
	}
	if (least != 0 && go[pos] == 'N')
	{
		ma = max(ma, din(pos - 1, least - 1));
	}
	if (go[pos] == 'Y')
	{
		ma = max(ma, din(pos - 1, k));
	}
	sost[pos][least] = ma;
	return ma;
}
int main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif
	int n;
	memset(sost, -1, sizeof(sost));
	cin >> n >> k;
	cin >> go;
	if (din(n - 1, k) > 0)
		puts("YES");
	else
		puts("NO");
	return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <map>
#include <algorithm>
#include <memory.h>

using namespace std;
long long MOD = 1000000007;
string go;
int sost[101][101];
int k;
int din (int pos, int least)
{
	if (sost[pos][least] != -1)
		return sost[pos][least];
	int ma = -1e9;
	if (pos == 0)
	{
		if (least == 1 && (go[0] == 'N' || go[0] == '?'))
			return 1;

		if (least == 0 && go[0] == 'N')
			return -1e9;

		if (least == 0 && go[0] == 'Y')
			return 1;
	}
	if (go[pos] == 'N' && least == 0)
		return -1e9;

	if (least == 0 && (go[pos] == '?' || go[pos] == 'Y'))
		ma = max(ma, din(pos - 1, k))+1;

	if (least != 0 && go[pos] == '?')
	{
		ma = max(ma, din(pos - 1, least - 1));
		ma = max(ma, din(pos - 1, k));
	}
	if (least != 0 && go[pos] == 'N')
	{
		ma = max(ma, din(pos - 1, least - 1));
	}
	if (go[pos] == 'Y')
	{
		ma = max(ma, din(pos - 1, k));
	}
	sost[pos][least] = ma;
	return ma;
}
int main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif
	int n;
	memset(sost, -1, sizeof(sost));
	cin >> n >> k;
	cin >> go;
	if (din(n - 1, k) > 0)
		puts("YES");
	else
		puts("NO");
	return 0;
}

#include <bits/stdc++.h>
#define rep(i,a,b) for(int i = a; i <=b ;i++)
using namespace std;

int main()
{
    //freopen("in.txt","r",stdin);
    int n,k; cin >> n >> k; char a[101];
    rep(i,1,n) cin >> a[i]; a[n+1] = 'Y';
    rep(i,1,n) if (a[i] == 'N')
    {
        int j = i;
        while (a[j+1] == 'N') j++;
        if (j - i + 1 > k) return cout << "NO",0;
        j = i;
    }
    if (k == 0) return cout << "YES",0;
    rep(i,1,n) if (a[i] == 'N' || a[i] == '?')
    {
        int j = i;
        while (a[j+1] == 'N' || a[j+1] == '?') j++;
        if (j - i + 1 == k) return cout << "YES",0;
        rep(x,i,j - k + 1) if (a[x-1]!='N' && a[x+k]!='N'   ) return cout << "YES",0;
        i = j;
    }
    return cout << "NO",0;
}

#include <iostream>
#include <string>

using namespace std;

int main()
{
	int n, k;
	cin >> n >> k;

	string s;
	cin >> s;

	int cnt = 0;

	for (int i = 0; i < n; i++) {
		cnt = (s[i] == 'N') ? cnt + 1 : 0;
		if (cnt > k) {
			cout << "NO";
			return 0;
		}
	}

	for (int i = 0; i <= n - k; ) {
		int j = i;
		while (j < n && s[j] != 'Y')
			j++;
		int cnt_y = j;

		if (j - i == k) {
			cout << "YES";
			return 0;
		}

		for (j = i; j <= cnt_y - k; j++) {
			if ((j == 0 || s[j - 1] != 'N') && (j + k == n || s[j + k] != 'N')) {
				cout << "YES";
				return 0;
			}
		}
		i = cnt_y + 1;
	}

	cout << "NO";
}

#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int dp[110][110][110];
int n,m;
char a[110];
int func(int here, int ch, int ch1) {
	if (here == n) {
		if (ch1 == m)return 1;
		else return 0;
	}
	int &ret = dp[here][ch][ch1];
	if (ret != -1)return ret;
	ret = 0;
	if (a[here] == 'N')
		ret = func(here + 1, ch + 1, max(ch + 1, ch1));
	else if (a[here] == 'Y')
		ret = func(here + 1, 0, ch1);
	else
	{
		ret = max(func(here + 1, ch + 1, max(ch + 1, ch1)), func(here + 1, 0, ch1));
	}
	return ret;
}
int main()
{
	memset(dp, -1, sizeof(dp));
	scanf("%d %d", &n,&m);
	for (int i = 0; i < n; i++)
		scanf(" %1c", &a[i]);
	if (func(0, 0, 0))
		puts("YES");
	else
		puts("NO");
}

#include "bits/stdc++.h"

using namespace std;

// M A F I A - M A F I A - M A F I A - M A F I A - M A F I A - M A F I A //

#define int                                       long long
#define lop(i,s,e)                                for(int i=s;i<(int)e;i++)
#define rlop(i,e,s)                               for(int i=e;i>=s;i--)
#define prvec(v)                                  lop(R15,0,v.size())cout << v[R15] <<" "; cout << endl;
#define prarr(arr,s1,e1)                          lop(R15,s1,e1)cout << arr[R15] << " "; cout << endl;

#define endl                                      '\n'
#define ff                                        first
#define ss                                        second
#define pii                                       pair<int,int>

#define pb                                        push_back
#define vi                                        vector<int>
#define vpii                                      vector< pii >

#define all(v)                                    v.begin(),v.end()
#define sz(re)                                    (int)re.size()
#define mset(a,f)                                 memset(a,f,sizeof(a))
#define M                                         1000000007
#define Think_Twice_Code_Once                     ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

bool J27 = 1;
#define bug(...)                                  __f (#__VA_ARGS__, __VA_ARGS__)
#define rtn                                       if(!J27)return;
template <typename Arg1>
void __f (const char* name, Arg1&& arg1) { rtn cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f (const char* names, Arg1&& arg1, Args&&... args)
{     rtn
     const char* comma = strchr (names + 1, ',');
     cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...);
}

// M A F I A - M A F I A - M A F I A - M A F I A - M A F I A - M A F I A //

inline void INP();
const int N = 3e6 + 7;
const long long INF = LLONG_MAX;
const int inf = INT_MAX;

int n, Q, k;
int arr[N+2];

void solve()
{
      cin >> n >> k;
      string str;
      cin >> str;

      bool ans = 0;
      int mn = 0, cnt = 0;
      lop(i,0,n)
      {
            if( str[i] == 'N' ) cnt++;
            else cnt = 0;
            mn = max(mn, cnt);
      }
      if( cnt == 0 and k == 0 ) ans = 1;

      lop(i,0,n)
      {
            if( (str[i] != 'Y') and  (i == 0 or str[i-1] != 'N') )
            {
                  bool f = 1;
                  int j = 0;
                  while( i + j < n and j <= k and str[i+j] != 'Y') j++;
                  if( j > k ) j--;
                  if( j < k ) f = 0;

                  if( i + j < n and str[i+j] == 'N' ) f = 0;
                  if( f ) ans = 1;
                  bug(i,j,f,ans);
            }
      }

      bug(mn);
      if( mn <= k and ans ) cout << "YES" << endl;
      else cout << "NO" << endl;
}

int32_t main()
{

      J27 = 0;
      Think_Twice_Code_Once;
      INP();
      int t = 1;
      //cin >> t;
      while(t--) solve();

}

inline void INP()
{
      #ifndef ONLINE_JUDGE
          freopen("input.txt",  "r",  stdin);
          freopen("output.txt", "w", stdout);
      #endif
}

// M A F I A - M A F I A - M A F I A - M A F I A - M A F I A - M A F I A //

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9+7;
int count(string s){
    s.push_back('?');
    int ans = 0, cur = 0;
    for(int i = 0; i < s.size(); ++i)
        if(s[i] == 'N')
            cur++;
        else{
            ans = max(ans,cur);
            cur = 0;
        }
    return ans;
}
int small(string s){
    for(char &c : s)
        if(c == '?')
            c = 'Y';
    return count(s);
}
bool match(string a, string b){
    for(int i = 0; i < a.size(); ++i)
        if(!(b[i] == a[i] || b[i] == '?'))
            return false;
    return true;
}
int main(){
    int n,k;
    cin >> n >> k;
    string s;
    cin >> s;
    if(small(s) > k){
        puts("NO");
        return 0;
    }
    s = 'Y' + s + 'Y';
    string req = "Y" + string(k,'N') + "Y";
    for(int i = 0; i < (int)s.size()-k+1; ++i)
        if(match(req,s.substr(i,k+2))){
            puts("YES");
            return 0;
        }
    puts("NO");
}

#include <iostream>
#include <fstream>
#include <cstdio>
#include <queue>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <stack>
#include <cstring>
#include <cmath>

#define MN 1000010
#define INF 2147483647
#define PI 3.14159265359
#define pairr pair<int, int>
#define pairrr pair<int, pairr>
#define f first
#define s second
#define pb push_back
#define ll long long
#define MOD 10000007
#define IO ios_base::sync_with_stdio(false); cin.tie();
#define PQT pairr
#define PQL priority_queue<PQT, vector<PQT>, less<PQT> >
#define PQG priority_queue<PQT, vector<PQT>, greater<PQT> >

using namespace std;

int n,k,i,t,ans=-1;
string s;

void f(int i, int t)
{
    if (i==n || t>k || t+n-i<k)
    {
        if (t==k)
        {
            cout<<"YES\n";
            exit(0);
        }
        return;
    }
    if (s[i]=='Y')
    {
        if (t==k)
        {
            cout<<"YES\n";
            exit(0);
        }
        f(i+1,0);
        return;
    }
    if (s[i]=='N')
    {
        f(i+1,t+1);
        return;
    }
    if (t==k)
    {
        cout<<"YES\n";
        exit(0);
    }
    f(i+1,0);
    f(i+1,t+1);
}

int main()
{
    IO
//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);
    cin>>n>>k>>s;
    for (i=0;i<n;i++)
    {
        if (s[i]=='N') t++;
        else
        {
            if (t>k)
            {
                cout<<"NO\n";
                exit(0);
            }
            t=0;
        }
    }
    if (t>k)
    {
        cout<<"NO\n";
        exit(0);
    }
    t=0;
    f(0,0);
    cout<<"NO\n";
    return 0;
}

#include<iostream>;
using namespace std;

int main() {
    int n, k;
    string s;
    cin >> n >> k;
    cin >> s;
    int a = 0;
    int max = 0;
    for (int i = 0; i < n; i++) {
        if (s[i] == 'N') {
            a++;
            if (max < a) {
                max = a;
            }
        } else {
            if (max < a) {
                max = a;
            }
           a = 0;
        }
    }
    if (max > k) {
        cout << "NO";
        return 0;
    }
    for (int i = 0; i < n - k + 1; i++) {
        if (i > 0 && s[i - 1] == 'N') {
            continue;
        }
        bool b = true;
        for (int j = i; j < i + k; j++) {
            if (s[j] == 'Y') {
                b = false;
                break;
            }
        }
        if (b && (i + k == n || s[i + k] != 'N')) {
            cout << "YES";
            return 0;
        }
    }
    cout << "NO";
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main() {
    int n,k; string s; cin>>n>>k>>s; bool flag = false;
    for(int i = k; i <= n; ++i) {
        string t = s;
        for(int j = 1; j <= i-k; ++j)
            if(t[j-1] == '?') t[j-1] = 'Y';
        for(int j = i+1; j <= n; ++j)
            if(t[j-1] == '?') t[j-1] = 'Y';
        for(int j = i-k+1; j <= i; ++j)
            if(t[j-1] == '?') t[j-1] = 'N';
        int c = 0, m = 0;
        for(int i = 1; i <= n; ++i) {
            if(t[i-1] == 'N') ++c;
            else {
                m = max(m,c);
                c = 0;
            }
        }
        m = max(m,c);
        if(m == k) {
            flag = true;
            break;
        }
    }
    if(flag) cout<<"YES\n";
    else cout<<"NO\n";
}

#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int main() {
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    int mx = 0, cur = 0;
    for (int i = 0; i < n; ++i) {
        if (s[i] != 'N') {
            mx = max(mx, cur);
            cur = 0;
        } else {
            ++cur;
        }
    }
    mx = max(mx, cur);
    if (mx > k) {
        cout << "NO\n";
        return 0;
    }
    int Y = 0;
    for (int i = 0; i < k; ++i) {
        Y += (s[i] == 'Y');
    }
    if (Y == 0 && (k >= n || s[k] != 'N')) {
        cout << "YES\n";
        return 0;
    }
    for (int r = k; r < n; ++r) {
        if (s[r - k] == 'Y') {
            --Y;
        }
        if (s[r] == 'Y') {
            ++Y;
        }
        if (Y == 0 && (s[r - k] != 'N' && (r + 1 >= n || s[r + 1] != 'N'))) {
            cout << "YES\n";
            return 0;
        }
    }
    cout << "NO\n";
    return 0;
}

#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define MOD 1000000007
#define pii pair<int,int>
#define large_int 2139062143
#define large_long_long_int 9187201950435737471
using namespace std;

#define NOV 100005

int check(string s){
	for(char c:s){
		if(c=='Y')
			return 0;
	}
	return 1;
}

int getmax(string s){
	int cnt = 0,mxcnt = 0;
	for(char c:s){
		if(c=='N'){
			cnt++;
			mxcnt = max(mxcnt, cnt);
		}
		else
			cnt = 0;
	}
	return mxcnt;
}

int main(){
	ios_base::sync_with_stdio(false);
	int n,k;
	cin>>n>>k;

	string s;
	cin>>s;
	int p = getmax(s);

	if( p > k)
	{
		cout<<"NO\n";
		return 0;
	}

	vector<string> v;

	for(int i=0;i<=n-k;i++){
		if(i>0)
			if(s[i-1]=='N')
				continue;
		if(i+k<n)
			if(s[i+k] == 'N')
				continue;
		v.pb(s.substr(i,k));
	}

	for(string st:v){
		if(check(st))
		{
			cout<<"YES\n";
			return 0;
		}
	}
	cout<<"NO\n";
}

#include <bits/stdc++.h>

using namespace std;

int f(string s) {
	int res = 0;
	int cur = 0;
	for(int i = 0; i < s.size(); i++)
		if(s[i] == 'N')
			cur++;
		else {
			res = max(res, cur);
			cur = 0;
		}
	return max(res, cur);
}

int main() {
	int n, k;
	string s;
	cin >> n >> k >> s;
	for(int i = 0; i < n; i++) {
		string b = s;
		for(int j = 0; j < i; j++)
			if(b[j] == '?')
				b[j] = 'Y';
		for(int j = i; j < i + k; j++)
			if(b[j] == '?')
				b[j] = 'N';
		for(int j = i + k; j < n; j++)
			if(b[j] == '?')
				b[j] = 'Y';
		if(f(b) == k) {
			cout << "YES";
			return 0;
		}
	}
	cout << "NO";
}

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main(){

    //Stepan's Series

    int i, n, k, prev, now, ans;
    string s;

    cin>>n>>k;
    cin>>s;

    prev=0;
    ans=0;

    for (i=0;i<n;i++){
        if (s[i]=='N'){
            now=prev+1;
        }
        else {
            now=0;
        }
        prev=now;
        ans=max(ans, now);
    }

    if (ans==k){
        cout<<"YES\n";
    }
    else if (ans<k){
        int j;
        bool b=true;
        vector <int> v;
        for (i=0;i<n;i++){
            if (s[i]=='N'||s[i]=='?'){
                if (b){
                    v.push_back(i);
                    b=false;
                }
            }
            else {
                b=true;
            }
        }
        for (i=0;i<v.size();i++){
            prev=0;
            ans=0;
            for (j=v[i];j<n;j++){
                if (s[j]=='N'){
                    now=prev+1;
                }
                else if (s[j]=='?'){
                    if (ans<k){
                        now=prev+1;
                    }
                    else {
                        now=0;
                    }
                }
                else {
                    now=0;
                }
                prev=now;
                ans=max(ans, now);
            }
            if (ans==k){
                break;
            }
        }
        if (ans==k){
            cout<<"YES\n";
        }
        else {
            cout<<"NO\n";
        }
    }
    else {
        cout<<"NO\n";
    }

    return 0;
}

#include "bits/stdc++.h"

using namespace std;

// M A F I A - M A F I A - M A F I A - M A F I A - M A F I A - M A F I A //

#define int                                       long long
#define lop(i,s,e)                                for(int i=s;i<(int)e;i++)
#define rlop(i,e,s)                               for(int i=e;i>=s;i--)
#define prvec(v)                                  lop(R15,0,v.size())cout << v[R15] <<" "; cout << endl;
#define prarr(arr,s1,e1)                          lop(R15,s1,e1)cout << arr[R15] << " "; cout << endl;

#define endl                                      '\n'
#define ff                                        first
#define ss                                        second
#define pii                                       pair<int,int>

#define pb                                        push_back
#define vi                                        vector<int>
#define vpii                                      vector< pii >

#define all(v)                                    v.begin(),v.end()
#define sz(re)                                    (int)re.size()
#define mset(a,f)                                 memset(a,f,sizeof(a))
#define M                                         1000000007
#define Think_Twice_Code_Once                     ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

bool J27 = 1;
#define bug(...)                                  __f (#__VA_ARGS__, __VA_ARGS__)
#define rtn                                       if(!J27)return;
template <typename Arg1>
void __f (const char* name, Arg1&& arg1) { rtn cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f (const char* names, Arg1&& arg1, Args&&... args)
{     rtn
     const char* comma = strchr (names + 1, ',');
     cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...);
}

// M A F I A - M A F I A - M A F I A - M A F I A - M A F I A - M A F I A //

inline void INP();
const int N = 3e6 + 7;
const long long INF = LLONG_MAX;
const int inf = INT_MAX;

int n, Q, k;
int arr[N+2];

void solve()
{
      cin >> n >> k;
      string str;
      cin >> str;

      bool ans = 0;
      int mn = 0, cnt = 0;
      lop(i,0,n)
      {
            if( str[i] == 'N' ) cnt++;
            else cnt = 0;
            mn = max(mn, cnt);
      }

      lop(i,0,n)
      {
            if( (str[i] != 'Y') and  (i == 0 or str[i-1] != 'N') )
            {
                  bool f = 1;
                  int j = 0;
                  while( i + j < n and j <= k and str[i+j] != 'Y') j++;
                  if( j > k ) j--;
                  if( j < k ) f = 0;

                  if( i + j < n and str[i+j] == 'N' ) f = 0;
                  if( j == k and f ) ans = 1;
                  bug(i,j,f,ans);
            }
      }

      if( mn <= k and ans ) cout << "YES" << endl;
      else cout << "NO" << endl;
}

int32_t main()
{

      J27 = 0;
      Think_Twice_Code_Once;
      INP();
      int t = 1;
      //cin >> t;
      while(t--) solve();

}

inline void INP()
{
      #ifndef ONLINE_JUDGE
          freopen("input.txt",  "r",  stdin);
          freopen("output.txt", "w", stdout);
      #endif
}

// M A F I A - M A F I A - M A F I A - M A F I A - M A F I A - M A F I A //

#include <algorithm>
#include <vector>
#include <iostream>
#include <map>
#include <fstream>
#include <set>
#include <queue>
#include <cmath>
#define all(x) x.begin(), x.end()

using namespace std;
typedef long long ll;

int main() {
	cin.tie(0), cout.tie(0), ios_base::sync_with_stdio(0);
	string s;
	int n, k;
	cin >> n >> k >> s;
	s = s + '8';
	vector<int>pr(s.size() + 1, 0), pp(s.size() + 1, 0);
	for (int i = s.size() - 2; i >= 0; --i) {
		if (s[i] == 'N')pp[i] = pp[i + 1] + 1;
		if (s[i] != 'Y')pr[i] = pr[i + 1] + 1;
		//cout << i << ": \n";
		//cout << "chain: " << pr[i] << "\n";
		//cout << "have n: " << pp[i] << "\n";
	}
	bool ok = 0;
	for (int i = 0; i < s.size(); ++i) {
		if (pr[i] >= k && s[i + k] != 'N') {
			if (i > 0 && s[i - 1] != 'N' || i == 0) {
				ok = 1;
				cout << i << " " << pr[i]<<"\n";
			}
		}
	}
	for (int i = 0; i < s.size() - 1; i++) {
		if (pp[i] > k) {
			cout << "NO"; exit(0);
		}
	}
	if (ok)cout << "YES";
	else cout << "NO";
	return 0;
}/*
 12 2 N?N

 12 2 YYYYYN?N

 0 6
 N??NN?NNY

 0 7
 N??NN??NY

 */

#include <iostream>
#include <string>

using namespace std;

int main()
{
	int n, k;
	cin >> n >> k;

	string s;
	cin >> s;

	int cnt = 0;

	for (int i = 0; i < n; i++) {
		cnt = (s[i] == 'N') ? cnt + 1 : 0;
		if (cnt > k) {
			cout << "NO";
			return 0;
		}
	}

	for (int i = 0; i < n - k; i++) {
		int j = i;
		while (j < n && s[j] != 'Y')
			j++;
		int cnt_y = j;

		if (j - i == k) {
			cout << "YES";
			return 0;
		}

		for (j = i; j < cnt_y - k; j++) {
			if ((j == 0 || s[j - 1] == '?') && (j + k == n || s[j + k] == '?')) {
				cout << "YES";
				return 0;
			}
		}
	}

	cout << "NO";
}

#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define inf 0x3f3f3f3f
char a[250];
int main()
{
    int n,k;
    scanf("%d%d",&n,&k);
    getchar();
    for(int i=1; i<=n; i++)
    {
        scanf("%c",&a[i]);
    }
    // printf("%s",a);
    int p=1,kk,maxx=0,flag=0;
    for(int i=1; i<=n; i+=p)
    {
        //printf("i=%d\n",i);
        if(a[i]=='N')
        {
            kk=0;
            for(int j=i; j<=n; j++)
            {
                if(a[j]=='N')
                {
                    kk++;
                }
                else
                {
                    p=kk;
                    break;
                }
            }
            maxx=max(maxx,kk);
            int kkk=kk;
          //  printf("%d\n",kk);
            if(kk<k)
            {
                for(int j=i-1; j>=1; j--)
                {
                    if((a[j]=='?'&&j==1)||(a[j]=='?'&&a[j-1]!='N'))
                    {
                        if(kk>=k)
                        {
                            if(kk==k)
                            {
                                flag=1;
                            }
                            break;
                        }
                        kk++;
                        if(kk>=k)
                        {
                            if(kk==k)
                            {
                                flag=1;
                            }
                            break;
                        }
                    }
                    else if(a[j]=='?'&&a[j-1]=='N')
                    {
                        if(kk>=k)
                        {
                            if(kk==k)
                            {
                                flag=1;
                            }
                            break;
                        }
                        kk++;
                    }
                    else if(a[j]=='N')
                        kk++;
                    else if(a[j]=='Y')
                    {
                        break;
                    }
                }
                if(flag==0)
                {
                    for(int j=i+p; j<=n; j++)
                    {
                        if((a[j]=='?'&&j==n)||(a[j]=='?'&&a[j+1]!='N'))
                        {
                            if(kkk>=k)
                            {
                                if(kkk==k)
                                {
                                    flag=1;
                                }
                                break;
                            }
                            kkk++;
                            if(kkk>=k)
                            {
                                if(kkk==k)
                                {
                                    flag=1;
                                }
                                break;
                            }
                        }
                        else if(a[j]=='?'&&a[j+1]=='N')
                        {
                            if(kkk>=k)
                            {
                                if(kkk==k)
                                {
                                    flag=1;
                                }
                                break;
                            }
                            kkk++;
                        }
                        else if(a[j]=='N')
                            kkk++;
                        else if(a[j]=='Y')
                        {
                            break;
                        }
                    }
                }

            }
         //   printf("%d %d %d\n",i,kk,kkk);

            //  maxx=max(maxx,kkk);
        }
        else
        {
            p=1;
        }
    }
    //printf("%d\n",maxx);
    if(maxx==k||(maxx<k&&flag))
        printf("YES\n");
    else printf("NO\n");
}

#include<bits/stdc++.h>
 using namespace std;

 int n, k, i, j, ans,val,l;
 string s;

 int main(){

    cin >> n >> k;
    cin >> s;

    for(i=0;i<s.size();++i){
        if(s[i]=='N'){
            ++ans;
            if(ans>k) return cout<<"NO\n",0;
        } else{
            ans = 0;
        }
    }

    for(i = 0; i < s.size(); ++i)
    for(j = i; j < s.size(); ++j){
            val = 0;
        for(l = 0; l < s.size(); ++l)
        if(s[l] == 'N'){
            ++val;
        } else{
        if(s[l]=='?'){
            if(l>=i && l<=j){
                ++val;
            }
           else {
            if(val == k) return cout << "YES\n",0;
            val = 0;
        }
        } else{
            if(val == k) return cout << "YES\n",0;
            val = 0;
        }
    }
    if(val == k) return cout << "YES\n",0;
    }

    return cout << "NO\n", 0;

 }

#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define inf 0x3f3f3f3f
char a[250];
int main()
{
    int n,k;
    scanf("%d%d",&n,&k);
    getchar();
    for(int i=1; i<=n; i++)
    {
        scanf("%c",&a[i]);
    }
    // printf("%s",a);
    int p=1,kk,maxx=0,flag=0,kkk,sum=0;
    for(int i=1; i<=n; i+=p)
    {
        //printf("i=%d\n",i);
        if(a[i]=='N')
        {
            kk=0;
            for(int j=i; j<=n; j++)
            {
                if(a[j]=='N')
                {
                    kk++;
                }
                else
                {
                    p=kk;
                    break;
                }
            }
            maxx=max(maxx,kk);
             kkk=kk;
            //  printf("%d\n",kk);
            if(kk<k)
            {
                for(int j=i-1; j>=1; j--)
                {
                    if((a[j]=='?'&&j==1)||(a[j]=='?'&&a[j-1]!='N'))
                    {
                        if(kk>=k)
                        {
                            if(kk==k)
                            {
                                flag=1;
                            }
                            break;
                        }
                        kk++;
                        if(kk>=k)
                        {
                            if(kk==k)
                            {
                                flag=1;
                            }
                            break;
                        }
                    }
                    else if(a[j]=='?'&&a[j-1]=='N')
                    {
                        if(kk>=k)
                        {
                            if(kk==k)
                            {
                                flag=1;
                            }
                            break;
                        }
                        kk++;
                    }
                    else if(a[j]=='N')
                        kk++;
                    else if(a[j]=='Y')
                    {
                        break;
                    }
                }
                if(flag==0)
                {
                    for(int j=i+p; j<=n; j++)
                    {
                        if((a[j]=='?'&&j==n)||(a[j]=='?'&&a[j+1]!='N'))
                        {
                            if(kkk>=k)
                            {
                                if(kkk==k)
                                {
                                    flag=1;
                                }
                                break;
                            }
                            kkk++;
                            if(kkk>=k)
                            {
                                if(kkk==k)
                                {
                                    flag=1;
                                }
                                break;
                            }
                        }
                        else if(a[j]=='?'&&a[j+1]=='N')
                        {
                            if(kkk>=k)
                            {
                                if(kkk==k)
                                {
                                    flag=1;
                                }
                                break;
                            }
                            kkk++;
                        }
                        else if(a[j]=='N')
                            kkk++;
                        else if(a[j]=='Y')
                        {
                            break;
                        }
                    }
                }

            }
            //   printf("%d %d %d\n",i,kk,kkk);

            //  maxx=max(maxx,kkk);
        }
        else
        {
            sum++;
            p=1;
        }
    }
    if(sum==n)
    {
        kk=0;
        for(int i=1;i<=n;i++)
        {
            if(a[i]=='?')
            {
                if(kk==k)
                {
                    flag=1;
                    break;
                }
                kk++;
                if(kk==k)
                {
                    flag=1;
                    break;
                }
            }
            else
            {
                kk=0;
            }
        }
    }
   // printf("%d\n",flag);
    if(maxx==k||(maxx<k&&flag))
        printf("YES\n");
    else printf("NO\n");
}

//#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <vector>
#include <deque>
#include <stack>
#include <fstream>
#include <cmath>
#include <cassert>
using namespace std;

#define MOD 1000000007

vector<uint64_t> factors(uint64_t x) {
    set<uint64_t> fac;
    vector<uint64_t> space;
    for (uint64_t i = 1; i <= uint64_t(sqrt(x)); i++) {
        if (x % i == 0) {
            fac.insert(x / i);
            fac.insert(i);
        }
    }

    for (auto& y : fac) {
        space.push_back(y);
    }
    return space;
}

int main() {
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	uint64_t n, k;
	cin >> n>> k;
    string s;
    cin >> s;
    int maxi = 0;
    int curr = 0;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == 'N') {
            curr++;
        }
        else {
            maxi = max(maxi, curr);
            curr = 0;
        }
    }
    maxi = max(maxi, curr);
    if (maxi > k) {
        cout << "NO" << endl;
        return 0;
    }
    else {
        if (maxi == k) {
            cout << "YES" << endl;
            return 0;
        }
        else {
            for (int i = 0; i <= s.size()-k; i++) {
                bool valid = true;
                if (i > 0 && s[i - 1] == 'N') continue;
                for (int j = 0; j < k; j++) {
                    if (s[i + j] == 'Y') {
                        valid = false;
                        break;
                    }
                }
                if (valid) {
                    if (i + k < s.size() && s[i + k] != 'N') {
                        cout << "YES" << endl;
                        return 0;
                    }
                }
            }
            cout << "NO" << endl;
            return 0;
        }
    }

	return 0;
}

#include <iostream>
#include <string>

using namespace std;

int main()
{
	int n, k;
	cin >> n >> k;

	string s;
	cin >> s;

	int cnt = 0;

	for (int i = 0; i < n; i++) {
		cnt = (s[i] == 'N') ? cnt + 1 : 0;
		if (cnt > k) {
			cout << "NO";
			return 0;
		}
	}

	for (int i = 0; i < n - k; ) {
		int j = i;
		while (j < n && s[j] != 'Y')
			j++;
		int cnt_y = j;

		if (j - i == k) {
			cout << "YES";
			return 0;
		}

		for (j = i; j < cnt_y - k; j++) {
			if ((j == 0 || s[j - 1] == '?') && (j + k == n || s[j + k] == '?')) {
				cout << "YES";
				return 0;
			}
		}
		i = cnt_y + 1;
	}

	cout << "NO";
}

#include <iostream>

using namespace std;

int main()
{
	int n, k, a = 0, nowmin = 0, nowmax = 0, min = 2147483647, max = 0, f = 1;
	cin >> n >> k;
	char* s = new char[n];
	cin >> s;

	for (a = 0; a < n; a++)
	{
		if (s[a] != 'Y') { nowmax++; if (max < nowmax) max++; }
		else nowmax = 0;
		if (s[a] == 'N') nowmin++;
		else { if ((nowmin != 0) & (min > nowmin)) { min = nowmin; } nowmin = 0; }
	}
	if ((s[a - 1] == 'N') & (min > nowmin)) min = nowmin;
	if (min == 2147483647) min = 0;
	if (k > max) { cout << "NO"; return 0; }
	if ((k == min) | (k == max)) { cout << "YES"; return 0; }
	if (k < min) { cout << "NO"; return 0; }

	n -= k;
	for (a = 0; a < n; a++)
	{
		for (int b = a; b < a + k; b++)
		{
			if (s[b] == 'Y') { f = 0; break; }
		}
		if (f)
		{
			if (a + k == n - 1) { cout << "YES"; return 0; }
			else if (s[a + k + 1] != 'N') f = 1;
			else f = 1;
		}
		else f = 1;
	}
	cout << "NO";
	return 0;
}

#include <iostream>
#include <fstream>
#include <string>
#include <queue>

using namespace std;

void clean(queue<int>& q)
{
	while (!q.empty())
		q.pop();
}

bool processNegative(int& currentNegative, queue<int>& questions,
	int&i, int k)
{
	++currentNegative;

	if (currentNegative > k)
	{
		if (!questions.empty())
		{
			i = questions.front();
			clean(questions);
			currentNegative = 0;
		}
		else
		{
			cout << "NO" << endl;
			return false;
		}
	}

	return true;
}

int main()
{
	// ifstream cin("input.txt");

	int n, k;
	string str;
	cin >> n >> k >> str;

	auto currentNegative = 0;
	auto hadResult = false;

	queue<int> questions;

	for (auto i = 0; i < n; i++)
	{
		switch (str[i])
		{
		case 'Y':
			if (currentNegative == k)
				hadResult = true;

			currentNegative = 0;
			clean(questions);
			break;
		case 'N':
			if (!processNegative(currentNegative, questions, i, k))
				return 0;
			break;
		case '?':
			if (currentNegative == k)
				hadResult = true;

			questions.push(i);
			if (!processNegative(currentNegative, questions, i, k))
				return 0;
			break;
		}
	}

	cout << (hadResult ? "YES" : "NO");
}

#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define inf 0x3f3f3f3f
char a[250];
int main()
{
   int n,k;
   scanf("%d%d",&n,&k);
   getchar();
   for(int i=0;i<n;i++)
   {
       scanf("%c",&a[i]);
       a[i+n]=a[i];
   }
  // printf("%s",a);
   int p=1,kk,maxx=0;
   for(int i=0;i<2*n;i+=p)
   {
       if(a[i]=='N')
       {
           kk=0;
           for(int j=i;j<2*n;j++)
           {
               if(a[j]=='N')
               {
                    kk++;
               }
                else
                {
                    p=j-i;
                    break;
                }
           }
          // printf("%d\n",i);
           maxx=max(maxx,kk);
       }
   }
   if(maxx>k)
   printf("NO\n");
   else printf("YES\n");
}

//#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <vector>
#include <deque>
#include <stack>
#include <fstream>
#include <cmath>
#include <cassert>
using namespace std;

#define MOD 1000000007

vector<uint64_t> factors(uint64_t x) {
    set<uint64_t> fac;
    vector<uint64_t> space;
    for (uint64_t i = 1; i <= uint64_t(sqrt(x)); i++) {
        if (x % i == 0) {
            fac.insert(x / i);
            fac.insert(i);
        }
    }

    for (auto& y : fac) {
        space.push_back(y);
    }
    return space;
}

int main() {
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	uint64_t n, k;
	cin >> n>> k;
    string s;
    cin >> s;
    int maxi = 0;
    int curr = 0;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == 'N') {
            curr++;
        }
        else {
            maxi = max(maxi, curr);
            curr = 0;
        }
    }
    if (curr > k) {
        cout << "NO" << endl;
        return 0;
    }
    else {
        if (curr == k) {
            cout << "YES" << endl;
            return 0;
        }
        else {
            for (int i = 0; i <= s.size()-k; i++) {
                bool valid = true;
                for (int j = 0; j < k; j++) {
                    if (s[i + j] == 'Y') {
                        valid = false;
                        break;
                    }
                }
                if (valid) {
                    if (i + k < s.size() || s[i + k] != 'N') {
                        cout << "YES" << endl;
                        return 0;
                    }
                }
            }
            cout << "NO" << endl;
            return 0;
        }
    }

	return 0;
}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int MAXN = 2e5 + 5;
const long long MOD = 1e9 + 7;

int main()
{
	//freopen("input.in","r",stdin);
    //freopen("output.out","w",stdout);

	int n,k; cin >> n >> k;
	string s; cin >> s;
	int c1 = 0; int c2 = 0;
	for(int i = 0; i < n;)
	{
		if(s[i] == 'N')
		{
			int j = i;
			while(j < n && s[j] == 'N')
				j++;
			c1 = max(c1,j - i);
			i = j;
		}
		else
		{
			i++;
		}
	}
	for(int i = 0; i < n;)
	{
		if(s[i] == 'N' || s[i] == '?')
		{
			int j = i;
			while(j < n && (s[j] == 'N' || s[j] == '?'))
				j++;
			c2 = max(c2,j - i);
			i = j;
		}
		else
		{
			i++;
		}
	}
	if(c1 > k || c2 < k){
		cout << "NO";
		return 0;
	}
	else
	{
		cout << "YES\n";
	}
	return 0;

}

#include <cstdlib>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <list>
#include <string>
#include <vector>
#include <sstream>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <cmath>
#include <functional>

typedef long long long64;
typedef long long int64;
using namespace std;

int main()
{
    //freopen("input.txt", "r", stdin);

		int n;
		int k;
		cin >> n >> k;

	    string a;
	    cin >> a;
bool no=false;
for(int i=0; i<a.size(); i++)
{
    if(a[i]=='N' && (i+k)<=a.size() && (i==0 || a[i-1]!='N'))
    {
       int count=0;
       int j;
       for(j=i; j<i+k; j++)
        {
            //cout << a[j];
            if(a[j]=='N')
                count ++;
            else
                break;
        }
        //cout << endl;
        if(count==k && j<a.size() && a[j]=='N')
        {
            cout << "NO";
            return 0;
        }
    }
}
for(int i=0; i<a.size(); i++)
{
	if((a[i]=='N' || a[i]=='?') && (i+k)<=a.size() && (i==0 || a[i-1]!='N'))
    {
       int count=0;
       int j;
       for(j=i; j<i+k; j++)
        {
            //cout << a[j];
            if(a[j]=='?' || a[j]=='N')
                count ++;
            else
                break;
        }
        //cout << endl;
        if(count==k && (i+k==a.size() || a[j]!='N'))
        {
            cout << "YES";
            return 0;
        }
    }
}

    cout << "NO";

	return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <ctime>
#include <cmath>
#include <string>
#include <stdlib.h>
#include <fstream>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <iterator>
#include <iomanip>
#include <climits>
#include <numeric>
#include <cstring>
#include <list>
using namespace std;
#define ll long long int

const int MAXN = 2e5 + 1;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n, k;
    string s;
    cin >> n >> k >> s;

    int cnt = 0, a = 0;

    for(int i = 0; i < n; ++i){
        if(s[i] == 'N'){
            if(i && s[i - 1] == 'N') cnt++;
            else cnt = 1;
        }
        if(s[i] != 'N') cnt = 0;

        a = max(a, cnt);
    }

    if(a > k){
        cout << "NO\n";
        return 0;
    }

    for(int i = 0; i <= n - k; ++i){
        bool ok = true;
        if(i && s[i - 1] == 'N') continue;
        if(i + k != n - 1 && s[i + k + 1] == 'N') continue;
        for(int j = i; j < i + k; ++j){
            if(s[j] == 'Y'){
                ok = false;
                break;
            }
        }

        if(ok){
            cout << "YES\n";
            return 0;
        }
    }

    cout << "NO\n";
}

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <algorithm>

using namespace std;

int main(){

    //Stepan's Series

    int i, n, k, prev, now, ans;
    string s;

    cin>>n>>k;
    cin>>s;

    prev=0;
    ans=0;

    for (i=0;i<n;i++){
        if (s[i]=='N'){
            now=prev+1;
        }
        else {
            now=0;
        }
        prev=now;
        ans=max(ans, now);
    }

    if (ans==k){
        cout<<"YES\n";
    }
    else if (ans<k){
        int j;
        for (i=0;i<n-k;i++){
            prev=0;
            ans=0;
            for (j=i;j<n;j++){
                if (s[j]=='N'){
                    now=prev+1;
                }
                else if (s[j]=='?'){
                    if (ans<k){
                        now=prev+1;
                    }
                    else {
                        now=0;
                    }
                }
                else {
                    now=0;
                }
                prev=now;
                ans=max(ans, now);
            }
            if (ans==k){
                break;
            }
        }
        if (ans==k){
            cout<<"YES\n";
        }
        else {
            cout<<"NO\n";
        }
    }
    else {
        cout<<"NO\n";
    }

    return 0;
}

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#define MIN 1<<31-1
#define REP(i,n) for(int i = 0; i < (n); i++)
typedef long long int ll;
char NN[10000];
int zu[10000];
using namespace std;
int main()
{
	int n,k,l,r;
	cin>>n>>k;
	l=0;r=0;
	int flag=0;
	int nowl=0;
	int cou=0;
	for(int i=0;i<n;i++)
	{
		cin>>NN[i];
	}
	int i;
	for(i=0;i<n;i++)
	{
		if((NN[i]=='N'||NN[i]=='?')&&NN[i-1]!='N')
		{
			int w;
			for(w=1;w<k;w++)
				if(w+i>=n||NN[w+i]=='Y')
					break;
			if(w==k&&NN[i+w+1]!='N')
			{
				break;
			}
		}
	}
	int out=0;
	if(i!=n)
		out=1;
	int mi=0;
	int nmi=0;
	for(i=0;i<n;i++)
	{
		if(NN[i]=='N')
		{
			nmi++;
		}
		else
		{
			mi=max(mi,nmi);
			nmi=0;
		}
	}
	if(out==1&&mi<=k)
		cout<<"YES";
	else
		cout<<"NO";
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

// IIT se hain BC!  //

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n,k;
	cin>>n>>k;
	char str[n+1];
	cin>>str;
	bool flag=true;
	for (int i = 0; i < n-k; ++i){
		int count=0;
		bool flag1=false;
		bool flag2=false;
		for (int j = 0; j < k; ++j){
			if(str[i+j]!='Y')
				count+=1;
		}
		if(count==k){
			flag=true;
			if(i>0&&str[i-1]=='N'){
				flag=false;
				break;
			}
			if(i<n-k-1&&str[i+k]=='N'){
				flag=false;
				break;
			}
		}
	}
	if(flag)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;

	return 0;
}

#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int main() {
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    int mx = 0, cur = 0;
    for (int i = 0; i < n; ++i) {
        if (s[i] != 'N') {
            mx = max(mx, cur);
            cur = 0;
        } else {
            ++cur;
        }
    }
    mx = max(mx, cur);
    if (mx > k) {
        cout << "NO\n";
        return 0;
    }
    int Y = 0;
    for (int i = 0; i < k; ++i) {
        Y += (s[i] == 'Y');
    }
    if (Y == 0) {
        cout << "YES\n";
        return 0;
    }
    for (int r = k; r < n; ++r) {
        if (s[r - k] == 'Y') {
            --Y;
        }
        if (s[k] == 'Y') {
            ++Y;
        }
        if (Y == 0) {
            cout << "YES\n";
            return 0;
        }
    }
    cout << "NO\n";
    return 0;
}

#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define inf 0x3f3f3f3f
char a[250];
int main()
{
   int n,k;
   scanf("%d%d",&n,&k);
   getchar();
   for(int i=0;i<n;i++)
   {
       scanf("%c",&a[i]);
       a[i+n]=a[i];
   }
  // printf("%s",a);
   int p=1,kk,maxx=0;
   for(int i=0;i<2*n;i+=p)
   {
       if(a[i]=='N')
       {
           kk=0;
           for(int j=i;j<2*n;j++)
           {
               if(a[j]=='N')
               {
                    kk++;
               }
                else
                {
                    p=j-i+1;
                    break;
                }
           }
          // printf("%d\n",kk);
           maxx=max(maxx,kk);
       }
   }
   if(maxx>k)
   printf("NO\n");
   else printf("YES\n");
}

//90 18
//NNNN?NNNNNYNYNYNNY?NNNNNNNNNNNNNNYNNNNNNYYNYYNNNNYNNNNNNNNNNNNNNNNNNNYNNYYNYNNNNNNNYNNNNYN

#include <iostream>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <bitset>
using namespace std;

#define in(s) freopen(s, "r", stdin);
#define out(s) freopen(s, "w", stdout);
#define forn(i, n) for (int i = 0; i < n; i++)
#define endl '\n'

typedef long long ll;
typedef long double ld;

int main()
{
	//in("cakes.in");
	//out("cakes.out");
	srand(1373737);
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int n, k;
	cin >> n >> k;

	string s;
	cin >> s;

	int p = 0, len = 0;
	while (p < s.size())
	{
		if (s[p] != 'N')
		{
			p++;
			continue;
		}
		int now = 0;
		while (p < s.size() && s[p] == 'N')
		{
			now++;
			p++;
		}
		len = max(len, now);
	}
	if (len > k)
	{
		cout << "NO";
		return 0;
	}
	vector <bool> fix(n);
	forn(i, n)
	{
		if (s[i] == '?')
			s[i] = 'N';
		else
			fix[i] = true;
	}
	p = 0; len = 0;
	while (p < s.size())
	{
		if (s[p] != 'N')
		{
			p++;
			continue;
		}
		int now = 0, start = p;
		while (p < s.size() && s[p] == 'N')
		{
			now++;
			p++;
			if (now == k)
			{
				if ((start - 1 < 0 || !fix[start - 1]) && (p + 1 >= n || !fix[p + 1]))
				{
					cout << "YES";
					return 0;
				}
				else
				{
					now--;
					start++;
				}
			}
		}
	}
	cout << "NO";
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int MAXN = 2e5 + 5;
const long long MOD = 1e9 + 7;

pair<int,int> p;

int main()
{
	//freopen("input.in","r",stdin);
    //freopen("output.out","w",stdout);

	int n,k; cin >> n >> k;
	string s; cin >> s;
	int c1 = 0; int c2 = 0;
	for(int i = 0; i < n;)
	{
		if(s[i] == 'N')
		{
			int j = i;
			while(j < n && s[j] == 'N')
				j++;
			c1 = max(c1,j - i);
			i = j;
		}
		else
		{
			i++;
		}
	}
	for(int i = 0; i < n;)
	{
		if(s[i] == 'N' || s[i] == '?')
		{
			int j = i;
			while(j < n && (s[j] == 'N' || s[j] == '?'))
				j++;
			c2 = max(c2,j - i);
			i = j;
		}
		else
		{
			i++;
		}
	}
	if(c1 > k || c2 < k){
		cout << "NO";
		return 0;
	}

	for(int i = 0; i < n; ++i)
	{
		for(int j = i; j < n; ++j)
		{
			if(j - i + 1 < k) continue;
			else
			{
				int c = 0;
				for(int l = i; l <= j; ++l)
				{
					if(s[l] == '?' || s[l] == 'N')
						c++;
				}
				if(c == k){
					int fl = 1;
					if(i - 1 >= 0 && s[i] == 'Y') fl = 0;
					if(j + 1 < n && s[j] == 'Y') fl = 0;
					if(fl)
					{
						cout << "YES\n";
						return 0;
					}
				}
			}
		}
	}
	cout << "NO";

	return 0;

}

#include <iostream>

using namespace  std;

int main(){
	int n, k;
	cin >> n >> k;
	string s;
	cin >> s;
	int min = 0;
	for (int i = 0; i<n; i++){
	    if (s[i] == 'N'){
	        int c = 0;
	        while ((i < n) && (s[i] == 'N')){
	            i++;
	            c++;
	            if (min < c)
	                min = c;
	        }
	    }
	}
	if (k < min){
	    cout << "NO";
	    return 0;
	}
	for (int i = 0; i <= n-k; i++){
	    if ((i > 0) && (s[i-1] == 'N'))
	        continue;
	    bool f = true;
	    for (int j = 0; j < k; j++)
	        if (s[i+j] == 'Y')
	            f = false;
	    if ((i+k+1 < n) && (s[i+k+1] == 'N'))
	        f = false;
	    if (f){
	        cout << "YES";
	        return 0;
	    }
	}
	cout << "NO";
	return 0;
}

#include <iostream>
#include <vector>
#include <string>

using namespace std;

bool check(string &s, int k, int ind)
{
    int cntr = 0;
    for (int i = ind; i < s.size(); i++)
    {
        if (s[i] == 'N' || s[i] == '?')
        {
            cntr++;
        }
        else if (s[i] == 'Y' && cntr < k)
            return false;
        if (cntr == k)
        {
            if (i == s.size() - 1)
                return true;
            else if (s[i+1] != 'N')
                return true;
            else
                return false;
        }
    }
    return false;
}

int main()
{
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    bool ok = check(s, k, 0);
    if (ok)
    {
        cout << "YES" << endl;
        return 0;
    }
    for (int i = 1; i < s.size(); i++)
        if ((s[i] == 'N' || s[i] == '?') && s[i-1] != 'N')
        {
            ok = check(s, k, i);
            if (ok)
                break;
        }

    if (ok)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
    return 0;
}

#include <iostream>

using namespace  std;

int main(){
	int n, k;
	cin >> n >> k;
	string s;
	cin >> s;
	int min = 0;
	for (int i=0; i<n; i++){
	    if (s[i] == 'N'){
	        int c = 0;
	        while ((i < n) && (s[i] == 'N')){
	            i++;
	            c++;
	            if (min < c)
	                min = c;
	        }
	    }
	}
	if (k < min){
	    cout << "NO";
	    return 0;
	}
	for (int i = 0; i < n-k; i++){
	    if ((i > 0) && (s[i-1] == 'N'))
	        continue;
	    bool f = true;
	    for (int j = 0; j < k; j++)
	        if (s[i+j] == 'Y')
	            f = false;
	    if ((i+k+1 < n) && (s[i+k+1] == 'N'))
	        f = false;
	    if (f){
	        cout << "YES";
	        return 0;
	    }
	}
	cout << "NO";
	return 0;
}

#include<iostream>;
using namespace std;

int main() {
    int n, k;
    string s;
    cin >> n >> k;
    cin >> s;
    int a = 0;
    int max = 0;
    for (int i = 0; i < n; i++) {
        if (s[i] == 'N') {
            a++;
            if (max < a) {
                max = a;
            }
        } else {
            if (max < a) {
                max = a;
            }
           a = 0;
        }
    }
    if (max > k) {
        cout << "NO";
        return 0;
    }
    for (int i = 0; i < n; i++) {
        if (i > 0 && s[i - 1] == 'N') {
            continue;
        }
        bool b = true;
        for (int j = i; j < i + k; j++) {
            if (s[j] == 'Y') {
                b = false;
                break;
            }
        }
        if (b && (i + k == n || s[i + k] != 'N')) {
            cout << "YES";
            return 0;
        }
    }
    cout << "NO";
    return 0;
}

#include<bits/stdc++.h>
 using namespace std;

 int n, k, i, j, ans,val,l;
 string s;

 int main(){

    cin >> n >> k;
    cin >> s;

    for(i=0;i<s.size();++i){
        if(s[i]=='N'){
            ++ans;
            if(ans>k) return cout<<"NO\n",0;
        } else{
            ans = 0;
        }
    }

    for(i = 0; i < s.size(); ++i)
    for(j = i; j < s.size(); ++j){
            val = 0;
        for(l = 0; l < s.size(); ++l)
        if(s[l] == 'N'){
            ++val;
        } else{
        if(s[l]=='?'){
            if(l>=i && l<=j){
                ++val;
            }
           else {
            if(val == k) return cout << "YES\n",0;
            val = 0;
        }
        } else{
            if(val == k) return cout << "YES\n",0;
            val = 0;
        }
    }
    if(val == k) return cout << "YES\n",0;
    }

    return cout << "NO\n", 0;

 }

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const int MAXN = 2e5 + 5;
const long long MOD = 1e9 + 7;

pair<int,int> p;

int main()
{
	//freopen("input.in","r",stdin);
    //freopen("output.out","w",stdout);

	int n,k; cin >> n >> k;
	string s; cin >> s;
	int c1 = 0; int c2 = 0;
	for(int i = 0; i < n;)
	{
		if(s[i] == 'N')
		{
			int j = i;
			while(j < n && s[j] == 'N')
				j++;
			c1 = max(c1,j - i);
			i = j;
		}
		else
		{
			i++;
		}
	}
	for(int i = 0; i < n;)
	{
		if(s[i] == 'N' || s[i] == '?')
		{
			int j = i;
			while(j < n && (s[j] == 'N' || s[j] == '?'))
				j++;
			c2 = max(c2,j - i);
			i = j;
		}
		else
		{
			i++;
		}
	}
	if(c1 > k || c2 < k){
		cout << "NO";
		return 0;
	}

	for(int i = 0; i < n; ++i)
	{
		for(int j = i; j < n; ++j)
		{
			if(j - i + 1 !=  k) continue;
			else
			{
				int c = 0;
				for(int l = i; l <= j; ++l)
				{
					if(s[l] == '?' || s[l] == 'N')
						c++;
				}
				if(c == k){
					int fl = 1;
					if(i - 1 >= 0 && s[i - 1] == 'N') fl = 0;
					if(j + 1 < n && s[j + 1] == 'N') fl = 0;
					if(fl)
					{
						cout << "YES\n";
						return 0;
					}
				}
			}
		}
	}
	cout << "NO";

	return 0;

}

#include <iostream>
#include <vector>
#include <algorithm>
#include <ctime>
#include <cmath>
#include <string>
#include <stdlib.h>
#include <fstream>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <iterator>
#include <iomanip>
#include <climits>
#include <numeric>
#include <cstring>
#include <list>
using namespace std;
#define ll long long int

const int MAXN = 2e5 + 1;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n, k;
    string s;
    cin >> n >> k >> s;

    int cnt = 0, a = 0;

    for(int i = 0; i < n; ++i){
        if(s[i] == 'N'){
            if(i && s[i - 1] == 'N') cnt++;
            else cnt = 1;
        }
        if(s[i] != 'N') cnt = 0;

        a = max(a, cnt);
    }

    if(a > k){
        cout << "NO\n";
        return 0;
    }

    for(int i = 0; i < n - k; ++i){
        bool ok = true;
        if(i && s[i - 1] == 'N') continue;
        int k = 0;
        if(i + k != n - 1 && s[i + k + 1] == 'N') continue;
        for(int j = i; j < i + k; ++j){
            k++;
            if(s[j] == 'Y'){
                ok = false;
                break;
            }
        }

        if(ok){
            cout << "YES\n";
            return 0;
        }
    }

    cout << "NO\n";
}

#include <bits/stdc++.h>
using namespace std;

const int N = 105;

char s[N];

bool dp[N][N][2];

bool solveDp(int ind,int cons,int g,int n,int k) {
    if(cons>k) {
        return false;
    }
    if(ind==n) {
        if(g) {
            return true;
        }
        else {
            return false;
        }
    }
    if(dp[ind][cons][g]) {
        return false;
    }
    dp[ind][cons][g] = true;
    if(s[ind]=='?') {
        int tmp = 0;
        int ng = g;
        if(tmp==k) {
            ng = 1;
        }
        if(solveDp(ind+1,tmp,ng,n,k) ){
            return true;
        }
        tmp = cons+1;
        ng = g;
        if(tmp==k) {
            ng = 1;
        }
        if(solveDp(ind+1,tmp,ng,n,k) ){
            return true;
        }
    }
    else if(s[ind]=='Y') {
        int tmp = 0;
        int ng = g;
        if(solveDp(ind+1,tmp,ng,n,k) ) {
            return true;
        }
    } else {
        int tmp = cons+1;
        int ng = g;
        if(tmp==k) {
            ng = 1;
        }
        if(solveDp(ind+1,tmp,ng,n,k) ) {
            return true;
        }
    }
    return false;
}

void solve() {
    int n,k;
    scanf("%d %d",&n,&k);
    scanf("%s",s);
    int g = 0;
    return;
    if(k==0) {
        g = 1;
    }
    if(solveDp(0,0,g,n,k)) {
        cout<<"YES\n";
    } else {
        cout<<"NO\n";
    }
}

int main()
{
    solve();
}

#include<bits/stdc++.h>
using namespace std;

#define ll       long long int
#define ull      unsigned long long int
#define pb       push_back
#define vpop     pop_back
#define mp       make_pair
#define ff       first
#define ss       second
#define clz(x)   __builtin_clz(x)       //count leading zeroes
#define ctz(x)   __builtin_ctz(x)       //count trailing zeroes
#define sbts(x)  __builtin_popcount(x) //count set bits
#define ps(x, y) fixed << setprecision(y) << x
#define all(v)   v.begin(), v.end()
#define umap	 unordered_map
const int MOD  =  1e9 + 7;
const ll INF   =  1e12;

int main() {
    // freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, k;
    cin >> n >> k;
    string str;
    cin >> str;
    int _maxN = 0, _maxQ = 0, N = 0, Q = 0;
    for(int i = 0; i < n; i++) {
        if(str[i] != 'N')   N = 0;
        else if(str[i] != '?')  Q = 0;
        if(str[i] == 'N')  {
            N++;    _maxN = max(_maxN, N);
        }
        else if(str[i] == '?')  {
            Q++;    _maxQ = max(_maxQ, Q);
        }
    }
    if(k == _maxN || (k > _maxN && k <= _maxQ))
        cout << "YES";
    else
        cout << "NO";
    return 0;
}

#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define inf 0x3f3f3f3f
char a[250];
int main()
{
   int n,k;
   scanf("%d%d",&n,&k);
   getchar();
   for(int i=0;i<n;i++)
   {
       scanf("%c",&a[i]);
       a[i+n]=a[i];
   }
  // printf("%s",a);
   int p=1,kk,maxx=0,flag=0;
   for(int i=0;i<2*n;i+=p)
   {
       if(a[i]=='N')
       {
           kk=0;
           for(int j=i;j<2*n;j++)
           {
               if(a[j]=='N')
               {
                    kk++;
               }
                else
                {
                    p=j-i+1;
                    break;
                }
           }
           if(kk==k)
           {
               flag=1;
           }
          else if(kk<k)
           {
               for(int j=i-1;j>=0;j--)
               {
                   if((a[j]=='?'&&a[j-1]!='N')||(a[j]=='?'&&j==0))
                   {
                       kk++;
                       if(kk==k)
                       {
                           flag=1;
                           break;
                       }
                   }
                  else if(a[j]=='N')
                    kk++;
                    else
                        break;
               }
               if(kk==k)
               {
                   flag=1;
               }
           }
          // printf("%d\n",kk);
           maxx=max(maxx,kk);
       }
   }
   if(maxx==k)
   printf("YES\n");
   else printf("NO\n");
}

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>

#define ll long long
#define pb push_back
using namespace std;

int main() {
	int n,k;
	scanf("%d%d", &n, &k);
	char s[105];
	scanf("%s", &s);
	s[n] = 'Y';
	int t,mx = 0;
	for (int i=0;i<n;++i)
	{
		t = 0;
		while(i<n && s[i]=='N')
		{
			t++;
			i++;
		}
		if (t>k)
		{
			cout<<"NO";
			return 0;
		}
		if (t>mx)
			mx = t;
		if (t!=0)
			i--;
	}
	if (mx==k)
	{
		cout<<"YES";
		return 0;
	}

//	cout<<mx<<endl;

	int j = -1;
	for (int i=0;i<n;++i)
	{
		cout<<i<<endl;
		t = 0;
		while(s[i]=='?' || s[i]=='N')
		{
			if (s[i]=='?' && j==-1)
				j = i;
			t++;
			i++;
			if (t==k)
			{
				if (s[i]=='N')
					break;
				else
				{
					cout<<"YES";
					return 0;
				}
			}
		}
		if (j!=-1)
		{
			i = j;
			j = -1;
		}
	}
cout<<"NO";
return 0;
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define PI 3.1415926535
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef pair <ll, ll> pll;

bool check(string &s, ll k) {
    ll cnt = 0;
    for(auto i: s) {
        if(i == 'N') cnt++;
        if(cnt > k) return false;
    }
    return true;
}

int main(){
    ios_base:: sync_with_stdio(0);
    //start();
    ll n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    if(!check(s, k)) {
        cout << "NO";
        return 0;
    }
    for(ll i = 0; i < n; i++) {
        if(s[i] == '?' || s[i] == 'N') {
            ll cnt = 0;
            while((s[i] == '?' && cnt < k)|| s[i] == 'N') {
                cnt++;
            }
            if(cnt == k) {
                cout << "YES";
                return 0;
            }
        }
    }
    cout << "NO";
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef complex<double> cplx;

#define sqr(x) ((x)*(x))
#define pb push_back
#define X first
#define Y second
#define sit(a) set<a>::iterator
#define mit(a,b) map<a,b>::iterator

const ll mod=1000000007LL;
const int inf=0x3f3f3f3f;
const int maxn=500005,maxm=10005;
const double eps=1e-10;
const double pi=acos(-1.0);

char c[maxn];
int n,k;
bool v[maxn]={0};

bool check()
{
    int i,j;
    for(i=0;i<n;i++)
    {
        for(j=i;j<i+k&&j<n&&c[j]=='N';j++);
        if(j<n&&j==i+k&&c[j]=='N') return 0;
    }
    return 1;
}

void solve()
{
    int i,j;
    for(i=0;i+k<=n;i++)
    {
        for(j=i;j<i+k&&c[j]!='Y';j++) c[j]='N';
        if(check()) {printf("YES\n");return;}
        for(j=i;j<i+k&&v[j];j++) c[j]='?';
    }
    printf("NO\n");
}

int main()
{
    int i,j;
    scanf("%d %d %s",&n,&k,c);
    for(i=0;i<n;i++) if(c[i]=='?') v[i]=1;
    solve();
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define MOD 1000000007

#define trace1(x)                    cout <<#x<<": "<<x<< endl;
#define trace2(x, y)                 cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)              cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)           cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;

typedef long long ll;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    ll i,j,n,m,k;
    cin>>n>>k;
    string s;
    cin>>s;
    ll pos=0;
    for(i=1;i<=n-k+1;i++)
    {
        ll r=0;
        for(j=0;j<k;j++)
        {
            if(s[i+j-1]=='Y')
            {
                j=-1;
                break;
            }
            else if(s[i+j-1]=='?')
            r++;
        }
        if(j!=-1)
        {
            if(i!=1 && s[i-2]=='N' && r==0)
            {
                cout<<"NO";
                return 0;
            }
            if(i+k-1+1<=n && s[i+k-1]=='N' && r==0)
            {
                cout<<"NO";
                return 0;
            }
            pos=1;
        }
    }
    if(pos==1)
    cout<<"YES";
    else
    cout<<"NO";
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main() {
    int n,k; string s; cin>>n>>k>>s; bool flag = false;
    for(int i = k; i <= n; ++i) {
        string t = s;
        for(int j = 1; j <= i-k; ++j)
            if(t[j-1] == '?') t[j-1] = 'Y';
        for(int j = i; j <= n; ++j)
            if(t[j-1] == '?') t[j-1] = 'Y';
        for(int j = i-k+1; j <= i; ++j)
            if(t[j-1] == '?') t[j-1] = 'N';
        int c = 0, m = 0;
        for(int i = 1; i <= n; ++i) {
            if(t[i-1] == 'N') ++c;
            else {
                m = max(m,c);
                c = 0;
            }
        }
        if(m == k) {
            flag = true;
            break;
        }
    }
    if(flag) cout<<"YES\n";
    else cout<<"NO\n";
}

#include<bits/stdc++.h>

#define mp make_pair
#define pb push_back
#define forn(i, n) for (int i = 0; i < n; i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define X first
#define Y second
#define y1 matveylox

using namespace std;

const int N = 400001;
const ll MAXN = (ll)1e6 + 7;
const int INF = (int)1e7;
const ll LINF = (ll)1e18;
const ll MOD = (ll)1e6 + 7;
const double eps = 0.00000000001;

int main()
{
    //freopen("input1.txt", "r", stdin);
    //freopen("cubes.out", "w", stdout);
    int n, v;
    string s;
    cin >> n >> v;
    cin >> s;
    s += "#";
    s = "#" + s;
    int k = 0;
    int ansk = 0, ansc = 0;
    forn(i, s.size())
    {
        if (s[i] == 'N')
            k++;
        else
        {
            ansk = max(ansk, k);
            k = 0;
        }
    }
    if (v < ansk)
        cout << "NO", exit(0);
    for(int i = 1; i <= n - v; i++)
    {
        bool f = true;
        for(int j = i; j < i + v; j++)
            if (s[j] == 'Y')
                f = false;
        if (f)
            if (s[i - 1] != 'N' && s[i + v] != 'N')
                cout << "YES", exit(0);
    }
    cout << "NO";
    return 0;
}

#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int main() {
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    int mx = 0, cur = 0;
    for (int i = 0; i < n; ++i) {
        if (s[i] != 'N') {
            mx = max(mx, cur);
            cur = 0;
        } else {
            ++cur;
        }
    }
    mx = max(mx, cur);
    if (mx > k) {
        cout << "NO\n";
        return 0;
    }
    int Y = 0;
    for (int i = 0; i < k; ++i) {
        Y += (s[i] == 'Y');
    }
    if (Y == 0) {
        cout << "YES\n";
        return 0;
    }
    for (int r = k; r < n; ++r) {
        if (s[r - k] == 'Y') {
            --Y;
        }
        if (s[r] == 'Y') {
            ++Y;
        }
        if (Y == 0 && (s[r - k] != 'N' && (r + 1 >= n || s[r + 1] != 'N'))) {
            cout << "YES\n";
            return 0;
        }
    }
    cout << "NO\n";
    return 0;
}

#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define inf 0x3f3f3f3f
char a[250];
int main()
{
    int n,k;
    scanf("%d%d",&n,&k);
    getchar();
    for(int i=1; i<=n; i++)
    {
        scanf("%c",&a[i]);
    }
    // printf("%s",a);
    int p=1,kk,maxx=0,flag=0,kkk;
    for(int i=1; i<=n; i+=p)
    {
        //printf("i=%d\n",i);
        if(a[i]=='N')
        {
            kk=0;
            for(int j=i; j<=n; j++)
            {
                if(a[j]=='N')
                {
                    kk++;
                }
                else
                {
                    p=kk;
                    break;
                }
            }
            maxx=max(maxx,kk);
             kkk=kk;
            //  printf("%d\n",kk);
            if(kk<k)
            {
                for(int j=i-1; j>=1; j--)
                {
                    if((a[j]=='?'&&j==1)||(a[j]=='?'&&a[j-1]!='N'))
                    {
                        if(kk>=k)
                        {
                            if(kk==k)
                            {
                                flag=1;
                            }
                            break;
                        }
                        kk++;
                        if(kk>=k)
                        {
                            if(kk==k)
                            {
                                flag=1;
                            }
                            break;
                        }
                    }
                    else if(a[j]=='?'&&a[j-1]=='N')
                    {
                        if(kk>=k)
                        {
                            if(kk==k)
                            {
                                flag=1;
                            }
                            break;
                        }
                        kk++;
                    }
                    else if(a[j]=='N')
                        kk++;
                    else if(a[j]=='Y')
                    {
                        break;
                    }
                }
                if(flag==0)
                {
                    for(int j=i+p; j<=n; j++)
                    {
                        if((a[j]=='?'&&j==n)||(a[j]=='?'&&a[j+1]!='N'))
                        {
                            if(kkk>=k)
                            {
                                if(kkk==k)
                                {
                                    flag=1;
                                }
                                break;
                            }
                            kkk++;
                            if(kkk>=k)
                            {
                                if(kkk==k)
                                {
                                    flag=1;
                                }
                                break;
                            }
                        }
                        else if(a[j]=='?'&&a[j+1]=='N')
                        {
                            if(kkk>=k)
                            {
                                if(kkk==k)
                                {
                                    flag=1;
                                }
                                break;
                            }
                            kkk++;
                        }
                        else if(a[j]=='N')
                            kkk++;
                        else if(a[j]=='Y')
                        {
                            break;
                        }
                    }
                }

            }
            //   printf("%d %d %d\n",i,kk,kkk);

            //  maxx=max(maxx,kkk);
        }
        else
        {
            p=1;
            if(a[i]=='?')
            {
                kk=kkk=0;
                if(kk<k)
                {
                    for(int j=i; j>=1; j--)
                    {
                        if((a[j]=='?'&&j==1)||(a[j]=='?'&&a[j-1]!='N'))
                        {
                            if(kk>=k)
                            {
                                if(kk==k)
                                {
                                    flag=1;
                                }
                                break;
                            }
                            kk++;
                            if(kk>=k)
                            {
                                if(kk==k)
                                {
                                    flag=1;
                                }
                                break;
                            }
                        }
                        else if(a[j]=='?'&&a[j-1]=='N')
                        {
                            if(kk>=k)
                            {
                                if(kk==k)
                                {
                                    flag=1;
                                }
                                break;
                            }
                            kk++;
                        }
                        else if(a[j]=='N')
                            kk++;
                        else if(a[j]=='Y')
                        {
                            break;
                        }
                    }
                    if(flag==0)
                    {
                        for(int j=i; j<=n; j++)
                        {
                            if((a[j]=='?'&&j==n)||(a[j]=='?'&&a[j+1]!='N'))
                            {
                                if(kkk>=k)
                                {
                                    if(kkk==k)
                                    {
                                        flag=1;
                                    }
                                    break;
                                }
                                kkk++;
                                if(kkk>=k)
                                {
                                    if(kkk==k)
                                    {
                                        flag=1;
                                    }
                                    break;
                                }
                            }
                            else if(a[j]=='?'&&a[j+1]=='N')
                            {
                                if(kkk>=k)
                                {
                                    if(kkk==k)
                                    {
                                        flag=1;
                                    }
                                    break;
                                }
                                kkk++;
                            }
                            else if(a[j]=='N')
                                kkk++;
                            else if(a[j]=='Y')
                            {
                                break;
                            }
                        }
                    }

                }
            }
        }
    }
    //printf("%d\n",maxx);
    if(maxx==k||(maxx<k&&flag))
        printf("YES\n");
    else printf("NO\n");
}

#include <iostream>

using namespace std;

int main()
{
	int n, k, a = 0, nowmin = 0, nowmax = 0, min = 0, max = 0, f = 1;
	cin >> n >> k;
	char* s = new char[n];
	cin >> s;

	for (a = 0; a < n; a++)
	{
		if (s[a] != 'Y') { nowmax++; if (max < nowmax) max++; }
		else nowmax = 0;
		if (s[a] == 'N') { nowmin++; if (min < nowmin) min++; }
		else nowmin = 0;
	}
	if ((s[a - 1] == 'N') & (min > nowmin)) min = nowmin;
	if (k > max) { cout << "NO"; return 0; }
	if ((k == min) | (k == max)) { cout << "YES"; return 0; }
	if (k < min) { cout << "NO"; return 0; }

	n -= k;
	for (a = 0; a < n; a++)
	{
		for (int b = a; b < a + k; b++)
		{
			if (s[b] == 'Y') { f = 0; break; }
		}
		if (f)
		{
			if (a == n - 1)
			{
				if (s[a - 1] == 'N') { cout << "NO"; return 0; }
				else { cout << "YES"; return 0; }
			}
			else if (a == 0)
			{
				if (s[a + k] == 'N') f = 1;
				else { cout << "YES"; return 0; }
			}
			else
			{
				if ((s[a - 1] != 'N') & (s[a + k] != 'N')) { cout << "YES"; return 0; }
				else f = 1;
			}
		}
		else f = 1;
	}
	cout << "NO";
	return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <ctime>
#include <cmath>
#include <string>
#include <stdlib.h>
#include <fstream>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <iterator>
#include <iomanip>
#include <climits>
#include <numeric>
#include <cstring>
#include <list>
using namespace std;
#define ll long long int

const int MAXN = 2e5 + 1;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n, k;
    string s;
    cin >> n >> k >> s;

    int cnt = 0, a = 0;

    for(int i = 0; i < n; ++i){
        if(s[i] == 'N'){
            if(i && s[i - 1] == 'N') cnt++;
            else cnt = 1;
        }
        if(s[i] != 'N') cnt = 0;

        a = max(a, cnt);
    }

    if(a > k){
        cout << "NO\n";
        return 0;
    }

    for(int i = 0; i < n - k; ++i){
        bool ok = true;
        if(i && s[i - 1] == 'N') continue;
        if(i + k != n - 1 && s[i + k + 1] == 'N') continue;
        for(int j = i; j < i + k; ++j){
            if(s[j] == 'Y'){
                ok = false;
                break;
            }
        }

        if(ok){
            cout << "YES\n";
            return 0;
        }
    }

    cout << "NO\n";
}

//I read the news today, oh boy
//About a lucky man who made the grade

#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz(x) int((x).size())
#define all(v) (v).begin(),(v).end()
#define trace(x) cerr << #x << " = " << x << endl
#define fastio ios_base::sync_with_stdio(0);cin.tie(0)
#define For(i,a,b) for(int i = int(a); i < int(b); ++i)
#define roF(i,a,b) for(int i = int(a); i >= int(b); i--)
using namespace std;

typedef long long ll;
typedef pair<int,int> ii;

int dp[1000];
int here[1000][1000];

int solve(string s){
	memset(dp,0,sizeof(dp));
	dp[0]=(s[0]=='N');
	For(i,1,sz(s)){
		if(s[i]!='N')dp[i]=0;
		else dp[i]=dp[i-1]+1;
	}
	int mx=0;
	For(i,0,sz(s))mx=max(mx,dp[i]);
	return mx;
}

int main(){
	fastio;
	int n,k;cin>>n>>k;
	string s;cin>>s;
	int mn=solve(s);
	if(k<mn){
		cout<<"NO"<<endl;
		return 0;
	}
	For(i,0,n)if(s[i]=='?')s[i]='N';
	bool find=false;
	For(i,0,sz(s))For(tam,1,i+1){
		if(i<sz(s)-1&&s[i+1]=='N')continue;
		here[i][tam]=true;
		For(j,i-tam+1,i+1)if(s[j]=='Y')
			here[i][tam]=false;
		if(i-tam>=0&&s[i-tam]=='N')here[i][tam]=false;
		if(tam==k&&here[i][tam])find=true;
	}
	if(find)cout<<"YES"<<endl;
	else cout<<"NO"<<endl;

	return 0;
}

#include <iostream>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <bitset>
using namespace std;

#define in(s) freopen(s, "r", stdin);
#define out(s) freopen(s, "w", stdout);
#define forn(i, n) for (int i = 0; i < n; i++)
#define endl '\n'

typedef long long ll;
typedef long double ld;

int main()
{
	//in("cakes.in");
	//out("cakes.out");
	srand(1373737);
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int n, k;
	cin >> n >> k;

	string s;
	cin >> s;

	int p = 0, len = 0;
	while (p < s.size())
	{
		if (s[p] != 'N')
		{
			p++;
			continue;
		}
		int now = 0;
		while (p < s.size() && s[p] == 'N')
		{
			now++;
			p++;
		}
		len = max(len, now);
		if (now == k)
		{
			cout << "YES";
			return 0;
		}
	}
	if (len > k)
	{
		cout << "NO";
		return 0;
	}
	vector <bool> fix(n);
	forn(i, n)
	{
		if (s[i] == '?')
			s[i] = 'N';
		else
			fix[i] = true;
	}
	p = 0; len = 0;
	while (p < s.size())
	{
		if (s[p] != 'N')
		{
			p++;
			continue;
		}
		int now = 0, start = p;
		while (p < s.size() && s[p] == 'N')
		{
			now++;
			if (now == k)
			{
				if ((start - 1 < 0 || (!fix[start - 1] && s[start - 1] == 'N' || s[start - 1] == 'Y')) && (p + 1 >= n || (!fix[p + 1] && s[p + 1] == 'N' || s[p + 1] == 'Y')))
				{
					cout << "YES";
					return 0;
				}
				else
				{
					now--;
					start++;
				}
			}
			p++;
		}
	}
	cout << "NO";
	return 0;
}

#include <iostream>
#include <stdio.h>
#include <cmath>
#include <math.h>
#include <string>
#include <algorithm>
#include <functional>
#include <stack>
#include <list>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <sstream>
#include <cassert>

#define PI 3.1415926535
#define ll long long
#define ull unsigned long long
#define umap unordered_map
#define uset unordered_set
#define all(a) a.begin(), a.end()
#pragma comment(linker, "/STACK:64777216")

using namespace std;

const int MAXINT = (int)2e9 + 100;
const ll MAXN = 100000;
const ll MAXVAL = 10000000;
const ll INF = (ll)1e18 + 50;
const ll MOD = (ll)1e9 + 7;
const ull HASH_MOD = 2305843009213693951;
string failMessage;

void fail()
{
	cout << failMessage;
	exit(0);
};

int f(string s)
{
	s += "Y";

	int max_len = -1, cur = 0;

	for (int i = 0; i < s.length(); i++)
	{
		if (s[i] != 'N')
		{
			max_len = max(max_len, cur);
			cur = 0;
		}
		else if (s[i] == 'N')
		{
			cur++;
		}
	}

	return max_len;
}

void solve()
{
	int n, k;
	cin >> n >> k;
	string s;
	cin >> s;

	int l = f(s);
	for (int i = 0; i < n; i++)
		if (s[i] == '?')
			s[i] = 'N';

	int r = f(s);

	if (k >= l && k <= r)
		cout << "YES";
	else
		cout << "NO";
}

int main()
{
	const string FILENAME = "111";
#ifndef LOCAL
	//freopen((FILENAME + ".in").data(), "r", stdin);
	//freopen((FILENAME + ".out").data(), "w", stdout);
#endif // !LOCAL

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.precision(15);
	solve();

}

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>

using namespace std;
typedef long long LL;
const LL INF=1e17L;
const int inf=0x3f3f3f3f;
const int maxn=1e3+5;
const int Mod=1e9+7;
int n,k;
string s;
int dp[maxn][maxn]; // dp[i][0]表示以i结尾可以构成的最短长度,dp[i][1]表示以i结尾可以构成的最长长度
/*
void init()
{

    for(int i=1;i<=n;i++)
    {
        p[i][i]=(s[i-1]=='Y')?0:1;
        for(int j=i+1;j<=n;j++)
        {
            p[i][j]=p[i][j-1]&((s[j-1]=='Y')?0:1);
        }
    }
}
*/
int main()
{

    cin>>n>>k>>s;
    //init();
    dp[0][0]=dp[0][1]=0;
    bool flag=false;
    for(int i=1;i<=n;i++)
    {
        char c=s[i-1];
        if(c=='Y')
        {
            dp[i][0]=dp[i][1]=0;
        }
        else if(c=='N')
        {
            dp[i][0]=dp[i-1][0]+1;
            dp[i][1]=dp[i-1][1]+1;
        }
        else if(c=='?')
        {
            dp[i][0]=0;
            dp[i][1]=dp[i-1][1]+1;
        }
        if(dp[i][0]>k) {flag=true;break;};
    }
    if(flag) puts("NO\n");
    else
    {
        int pos=n,t=0;
        while(pos>=1 && !t)
        {
            if(dp[pos][1]>=k) t=1;
            pos--;
        }
        if(t) puts("YES");else puts("NO");
    }
    return 0;
}

#include <iostream>
#include <fstream>
#include <cstdio>
#include <queue>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <stack>
#include <cstring>
#include <cmath>

#define MN 1000010
#define INF 2147483647
#define PI 3.14159265359
#define pairr pair<int, int>
#define pairrr pair<int, pairr>
#define f first
#define s second
#define pb push_back
#define ll long long
#define MOD 10000007
#define IO ios_base::sync_with_stdio(false); cin.tie();
#define PQT pairr
#define PQL priority_queue<PQT, vector<PQT>, less<PQT> >
#define PQG priority_queue<PQT, vector<PQT>, greater<PQT> >

using namespace std;

int n,k,i,t,z,ans=-1;
string s;

int main()
{
    IO
//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);
    cin>>n>>k;
    cin>>s;
    for (i=0;i<s.length();i++)
    {
        if (s[i]=='Y')
        {
            if (t==k)
            {
                ans=1;
                break;
            }
            if (t>k)
            {
                ans=0;
                break;
            }
            t=0;
        }
        else
        if (s[i]=='N')
        {
            t++;
        }
    }
            if (t==k)
            {
                ans=1;
            }
            if (t>k) ans=0;
    if (ans==1) cout<<"YES\n";
    else
    if (ans==0) cout<<"NO\n";
    else
    {
        t=0;
        for (i=0;i<s.length();i++)
        {
            if (s[i]=='Y')
            {
                if (t+z>=k)
                {
                    ans=1;
                    break;
                }
                t=0;
                z=0;
            }
            else
            if (s[i]=='?')
            {
                z++;
            }
            else
            {
                t++;
            }
        }
        if (ans==1) cout<<"YES\n";
        else cout<<"NO\n";
    }
    return 0;
}

//I read the news today, oh boy
//About a lucky man who made the grade

#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz(x) int((x).size())
#define all(v) (v).begin(),(v).end()
#define trace(x) cerr << #x << " = " << x << endl
#define fastio ios_base::sync_with_stdio(0);cin.tie(0)
#define For(i,a,b) for(int i = int(a); i < int(b); ++i)
#define roF(i,a,b) for(int i = int(a); i >= int(b); i--)
using namespace std;

typedef long long ll;
typedef pair<int,int> ii;

int dp[1000];
int here[1000][1000];

int solve(string s){
	memset(dp,0,sizeof(dp));
	dp[0]=(s[0]=='N');
	For(i,1,sz(s)){
		if(s[i]!='N')dp[i]=0;
		else dp[i]=dp[i-1]+1;
	}
	int mx=0;
	For(i,0,sz(s))mx=max(mx,dp[i]);
	return mx;
}

int main(){
	fastio;
	int n,k;cin>>n>>k;
	string s;cin>>s;
	int mn=solve(s);
	if(k<mn){
		cout<<"NO"<<endl;
		return 0;
	}
	bool find=false;
	s.pb('Y');
	For(i,0,n)For(tam,1,i+2){
		if(s[i+1]=='N')continue;
		here[i][tam]=true;
		For(j,i-tam+1,i+1)if(s[j]=='Y')
			here[i][tam]=false;
		//if(i==11&&tam==7)trace(here[i][tam]);
		if(i-tam>=0&&s[i-tam]=='N')here[i][tam]=false;
		if(tam==k&&here[i][tam])find=true;
	}
	if(find)cout<<"YES"<<endl;
	else cout<<"NO"<<endl;

	return 0;
}

#include<bits/stdc++.h>

#define mp make_pair
#define pb push_back
#define forn(i, n) for (int i = 0; i < n; i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define X first
#define Y second
#define y1 matveylox

using namespace std;

const int N = 400001;
const ll MAXN = (ll)1e6 + 7;
const int INF = (int)1e7;
const ll LINF = (ll)1e18;
const ll MOD = (ll)1e6 + 7;
const double eps = 0.00000000001;

int main()
{
    //freopen("input1.txt", "r", stdin);
    //freopen("cubes.out", "w", stdout);
    int n, v;
    string s;
    cin >> n >> v;
    cin >> s;
    s += "#";
    int k = 0;
    int ansk = 0, ansc = 0;
    forn(i, s.size())
    {
        if (s[i] == 'N')
            k++;
        else
        {
            ansk = max(ansk, k);
            k = 0;
        }
    }
    int c = 0;
    forn(i, s.size())
    {
        if (s[i] == 'N' || s[i] == '?')
            c++;
        else
        {
            ansc = max(ansc, c);
            c = 0;
        }
    }
    //cout << ansk << ' ' << ansc;
    if (v >= min(ansk, ansc) && v <= max(ansk, ansc))
        cout << "YES";
    else
        cout << "NO";
    return 0;
}

#include <bits/stdc++.h>
#define maxn 200
using namespace std;

int n, m;
char a[maxn];

int main()
{
	scanf("%d%d", &n, &m);
	scanf("%s", a + 1);

	if(m == 0)  //特判
	{
		for(int i = 1; i <= n; ++i)
		{
			if(a[i] == 'N')
			{
				printf("NO\n");
				return 0;
			}
		}
		printf("YES\n");
		return 0;
	}
	if(m == n)
	{
		for(int i = 1; i <= n; ++i)
		{
			if(a[i] == 'Y')
			{
				printf("NO");
				return 0;
			}
		}
		printf("YES");
		return 0;
	}

	int cnt = 0, ansn = 0;
	for(int i = 1; i <= n; ++i)
	{
		if(a[i] == 'N')
		{
			cnt++;
		}
		else
		{
			cnt = 0;
		}

		ansn = max(ansn, cnt);
	}

	if(ansn > m)
	{
		printf("NO");
		return 0;
	}
	if(ansn == m)
	{
		printf("YES");
		return 0;
	}

	//针对？的情况
	for(int i = 1; i <= n; ++i)
	{
		if(a[i] == 'Y')
			continue;
		if(i + m > n + 1)
			break;

		bool ok = true; //一开始认为是好的
		for(int k = i; k <= i + m - 1; ++k)
		{
			if(a[k] == 'Y') //判断是否是好的
			{
				ok = false;
				break;
			}
		}
		if(ok && a[i + m] != 'N')
		{
			printf("YES");
			return 0;
		}
	 }
	 printf("NO");

	return 0;
}

//#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <vector>
#include <deque>
#include <stack>
#include <fstream>
#include <cmath>
#include <cassert>
using namespace std;

#define MOD 1000000007

vector<uint64_t> factors(uint64_t x) {
    set<uint64_t> fac;
    vector<uint64_t> space;
    for (uint64_t i = 1; i <= uint64_t(sqrt(x)); i++) {
        if (x % i == 0) {
            fac.insert(x / i);
            fac.insert(i);
        }
    }

    for (auto& y : fac) {
        space.push_back(y);
    }
    return space;
}

int main() {
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	uint64_t n, k;
	cin >> n>> k;
    string s;
    cin >> s;
    int maxi = 0;
    int curr = 0;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == 'N') {
            curr++;
        }
        else {
            maxi = max(maxi, curr);
            curr = 0;
        }
    }
    maxi = max(maxi, curr);
    if (curr > k) {
        cout << "NO" << endl;
        return 0;
    }
    else {
        if (curr == k) {
            cout << "YES" << endl;
            return 0;
        }
        else {
            for (int i = 0; i <= s.size()-k; i++) {
                bool valid = true;
                if (i > 0 && s[i - 1] == 'N') continue;
                for (int j = 0; j < k; j++) {
                    if (s[i + j] == 'Y') {
                        valid = false;
                        break;
                    }
                }
                if (valid) {
                    if (i + k < s.size() && s[i + k] != 'N') {
                        cout << "YES" << endl;
                        return 0;
                    }
                }
            }
            cout << "NO" << endl;
            return 0;
        }
    }

	return 0;
}

#include <bits/stdc++.h>

using namespace std;

string s;

int main() {
 int n, k;
 cin >> n >> k >> s;
 s = "Y" + s + "Y";
int j = 0; int d = 0; int mn = 0; int ok = 0;
 for(int i = 1; i <= n+1; i++) {
  if(s[i] != 'N') {
   if(i-j-1 >= k) ok = 1;
   d = 0;
   if(s[i] == 'Y') j = i;
  }
  else mn = max(mn, ++d);
 }
 if(ok && mn <= k) cout << "YES" << endl;
 else cout << "NO" << endl;
}

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>

#define ll long long
#define pb push_back
using namespace std;

int main() {
	int n,k;
	scanf("%d%d", &n, &k);
	char s[105];
	scanf("%s", &s);
	s[n] = 'Y';
	int t,mx = 0;
	for (int i=0;i<n;++i)
	{
		t = 0;
		while(i<n && s[i]=='N')
		{
			t++;
			i++;
		}
		if (t>k)
		{
			cout<<"NO";
			return 0;
		}
		if (t>mx)
			mx = t;
		if (t!=0)
			i--;
	}
	if (mx==k)
	{
		cout<<"YES";
		return 0;
	}

//	cout<<mx<<endl;

	int j = -1;
	for (int i=0;i<n;++i)
	{
		cout<<i<<endl;
		t = 0;
		while(s[i]=='?' || s[i]=='N')
		{
			if (s[i]=='?' && j==-1)
				j = i;
			t++;
			i++;
			if (t==k)
			{
				if (s[i]=='N')
					break;
				else
				{
					cout<<"YES";
					return 0;
				}
			}
		}
		if (j!=-1)
		{
			i = j;
			j = -1;
		}
	}
cout<<"NO";
return 0;
}

#include <algorithm>
#include <vector>
#include <iostream>
#include <map>
#include <fstream>
#include <set>
#include <queue>
#include <cmath>
#define all(x) x.begin(), x.end()

using namespace std;
typedef long long ll;

int main() {
	cin.tie(0), cout.tie(0), ios_base::sync_with_stdio(0);
	string s;
	int n, k;
	cin >> n >> k >> s;
	s = s + '8';
	vector<int>pr(s.size() + 1, 0), pp(s.size() + 1, 0);
	for (int i = s.size() - 1; i >= 0; --i) {
		if (s[i] == 'N')pp[i] = pp[i + 1] + 1;
		if (s[i] != 'Y')pr[i] = pr[i + 1] + 1;
	}
	bool ok = 0;
	for (int i = 0; i < s.size(); ++i) {
		if (pr[i] >= k && s[i + k] != 'N') {
			if (i > 0 && s[i - 1] != 'N' || i == 0) {
				ok = 1;
				//cout << i << " " << pr[i]<<"\n";
			}
		}
	}
	for (int i = 0; i < s.size() - 1; i++) {
		if (pp[i] > k) {
			cout << "NO"; exit(0);
		}
	}
	if (ok)cout << "YES";
	else cout << "NO";
	return 0;
}/*
 0 7
 N??NN??NY

 */

#include <stdio.h>
#include <bits/stdc++.h>

#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)

#define file ""

using namespace std;
using ll = long long;
using ull = unsigned long long;
using str = string;
using srt = short;

const int INF = (int)1e9 + 7;
const int mod = 998244353;
const ll inf = (ll)1e18;
const ull oo = 1000000000000001;
const int N = 200005;

signed main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	ios::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr); //freopen(file".in", "r", stdin); freopen(file".out", "w", stdout);

	int n, k;
	cin >> n >> k;
	str s;
	cin >> s;
	s = '#' + s + '#';
	int cnt = 0;
	for (int i = 1; i <= n; ++i)
	{
		if (s[i] == 'N')
			++cnt;
		else
			cnt = 0;
	}
	if (k < cnt || n < k)
	{
		cout << "NO";
	}
	else
	{
		for (int i = 1; i + k - 1 <= n; ++i)
		{
			bool ok = (s[i - 1] != 'N' && s[i + k] != 'N');
			for (int j = i; ok && j <= i + k - 1; ++j)
			{
				ok &= (s[j] != 'Y');
			}
			if (ok)
			{
				cout << "YES";
				return 0;
			}
		}
		cout << "NO";
	}
}

#include <bits/stdc++.h>
using namespace std;
int main() {
    int n,k; string s; cin>>n>>k>>s; bool flag = false;
    for(int i = k; i <= n; ++i) {
        string t = s;
        for(int j = 1; j <= i-k; ++j)
            if(t[j-1] == '?') t[j-1] = 'Y';
        for(int j = i; j <= n; ++j)
            if(t[j-1] == '?') t[j-1] = 'Y';
        for(int j = i-k+1; j <= i; ++j)
            if(t[j-1] == '?') t[j-1] = 'N';
        int c = 0, m = 0;
        for(int i = 1; i <= n; ++i) {
            if(t[i-1] == 'N') ++c;
            else {
                m = max(m,c);
                c = 0;
            }
        }
        if(m == k) {
            flag = true;
            break;
        }
    }
    if(flag) cout<<"YES\n";
    else cout<<"NO\n";
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

	typedef tree<
			int,
			null_type,
			less<int>,
			rb_tree_tag,
			tree_order_statistics_node_update>
	ordered_set;

#define ll long long

int main(){
	ios::sync_with_stdio(false);cin.tie(0);
	ll n,k;cin>>n>>k;
	string str;cin>>str;
	ll max_val=0;
	if(str[0]=='N') max_val++;
	ll temp=max_val;
	for(int i=1;i<str.length();i++){
		if(str[i]=='N' || str[i]=='?'){
			temp++;
			max_val=max(max_val,temp);
		}else{
			temp=0;
			while(i<str.length() && (str[i]!='N' &&  str[i]=='?')){
				i++;
			}
			if(i<str.length() && ( str[i]=='N' || str[i]=='?') ){
				temp=1;
				max_val=max(max_val,temp);
			}
		}
	}
	if(max_val>=k) cout<<"YES\n";
	else cout<<"NO\n";
	return 0;

}

#include <bits/stdc++.h>
#define maxn 110
using namespace std;

char a[maxn];
int f[maxn], g[maxn];
int n, m;
int ans;

int main()
{
	scanf("%d%d", &n, &m);
	gets(a + 1);
	gets(a + 1);

	for(int i = 1; i <= n; ++i)
	{
		if(a[i] == 'N' && a[i - 1] != 'N')
		{
			f[i] = 1;
		}
	}
	/*
	for(int i = 1; i <= n; ++i)
		printf("%d ", f[i]);
	cout << endl;
	*/

	bool flag = false;
	for(int i = 1; i <= n; ++i)
	{
		if(a[i - 1] == a[i] && a[i] == 'N')
		{
			f[i] = f[i - 1] + 1;
		}
		if(f[i] == m && a[i + 1] != 'N')
		{
			flag = true;
		}
	}
	if(flag)
	{
		for(int i = 1; i <= n; ++i)
		{
			if(f[i] > m)
			{
				printf("NO\n");
				return 0;
			}
		}
		printf("YES\n");
		return 0;
	}

	//考虑有?的情况
	for(int i = 1; i <= n; ++i)
	{
		if(a[i] == 'Y')
			continue;
		int tem = (f[i] != 0) ? f[i] : 0;
		if(a[i] == '?')
		{
			tem++;
		}
		if(a[i - 1] == '?')
		{
			int x = i - 1;
			while(a[x] == '?' || a[x] == 'N')
			{
				tem++;
				if(tem == m && a[x - 1] != 'N')
				{
					printf("Yes\n");
					return 0;
				}

				x--;
			}
		 }
		 if(a[i + 1] == '?')
		 {
		 	int y = i + 1;
		 	while(a[y] == '?' || a[y] == 'N')
		 	{
		 		tem++;
		 		if(tem == m && a[y + 1] != 'N')
		 		{
		 			printf("YES\n");
		 			return 0;
				 }

				 y++;
			 }
		 }
	}

	printf("NO\n");

	return 0;
}

#include <bits/stdc++.h>
#define maxn 106
using namespace std;

char a[maxn];
int f[maxn], g[maxn];
int n, m;
int ans;

int main()
{
	scanf("%d%d", &n, &m);
	gets(a + 1);
	gets(a + 1);

	bool flag = true;
	for(int i = 1; i <= n; ++i)
	{
		if(a[i] == 'N' && a[i - 1] != 'N')
		{
			f[i] = 1;
		}
	}

	for(int i = 2; i <= n; ++i)
	{
		if(a[i - 1] == a[i] && a[i] == 'N')
		{
			f[i] = f[i - 1] + 1;
		}
		if(f[i] > m)
		{
			printf("NO\n");
			return 0;
		}
		if(f[i] == 2)
		{
			printf("YES\n");
			return 0;
		}
	}

	//考虑有?的情况
	for(int i = 1; i <= n; ++i)
	{
		if(a[i] == 'Y')
			continue;
		int tem = (f[i] != 0) ? f[i] : 0;
		if(a[i] == '?')
		{
			tem++;
		}
		if(a[i - 1] == '?')
		{
			int x = i - 1, ans = tem;
			while(a[x] == '?')
			{
				tem++;
				if(tem == m && a[x - 1] != 'N')
				{
					printf("Yes\n");
					return 0;
				}

				x--;
				while(a[x] == 'N')
				{
					tem ++;
					x--;
					if(tem == m && a[x] != 'N')
		 			{
		 				printf("YES\n");
		 				return 0;
				 	}
				}
			}
		 }
		 if(a[i + 1] == '?')
		 {
		 	int y = i + 1;
		 	while(a[y] == '?')
		 	{
		 		tem++;
		 		if(tem == m && a[y + 1] != 'N')
		 		{
		 			printf("YES\n");
		 			return 0;
				 }

				 y++;
				 while(a[y] == 'N')
				 {
				 	tem++;
				 	y++;
				 	if(tem == m && a[y] != 'N')
		 			{
		 				printf("YES\n");
		 				return 0;
				 	}
				 }
			 }
		 }
	}

	printf("NO\n");

	return 0;
}

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main(){

    //Stepan's Series

    int i, n, k, prev, now, ans;
    string s;

    cin>>n>>k;
    cin>>s;

    prev=0;
    ans=0;

    for (i=0;i<n;i++){
        if (s[i]=='N'){
            now=prev+1;
        }
        else {
            now=0;
        }
        prev=now;
        ans=max(ans, now);
    }

    if (ans==k){
        cout<<"YES\n";
    }
    else if (ans<k){
        int j;
        bool b=true;
        vector <int> v;
        for (i=0;i<n;i++){
            if (s[i]=='N'||s[i]=='?'){
                if (b){
                    v.push_back(i);
                    b=false;
                }
            }
            else {
                b=true;
            }
        }
        for (i=0;i<v.size();i++){
            prev=0;
            ans=0;
            for (j=v[i];j<n;j++){
                if (s[j]=='N'){
                    now=prev+1;
                }
                else if (s[j]=='?'){
                    if (ans<k){
                        now=prev+1;
                    }
                    else {
                        now=0;
                    }
                }
                else {
                    now=0;
                }
                prev=now;
                ans=max(ans, now);
            }
            if (ans==k){
                break;
            }
        }
        if (ans==k){
            cout<<"YES\n";
        }
        else {
            cout<<"NO\n";
        }
    }
    else {
        cout<<"NO\n";
    }

    return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <ctime>
#include <cmath>
#include <string>
#include <stdlib.h>
#include <fstream>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <iterator>
#include <iomanip>
#include <climits>
#include <numeric>
#include <cstring>
#include <list>
using namespace std;
#define ll long long int

const int MAXN = 2e5 + 1;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n, k;
    string s;
    cin >> n >> k >> s;

    int cnt = 0, a = 0;

    for(int i = 0; i < n; ++i){
        if(s[i] == 'N'){
            if(i && s[i - 1] == 'N') cnt++;
            else cnt = 1;
        }
        if(s[i] != 'N') cnt = 0;

        a = max(a, cnt);
    }

    if(a > k){
        cout << "NO\n";
        return 0;
    }

    for(int i = 0; i < n - k; ++i){
        bool ok = true;
        if(i && s[i - 1] == 'N') continue;
        if(i + k != n - 1 && s[i + k + 1] == 'N') continue;
        for(int j = i; j < i + k; ++j){
            if(s[j] == 'Y'){
                ok = false;
                break;
            }
        }

        if(ok){
            cout << "YES\n";
            return 0;
        }
    }

    cout << "NO\n";
}

#include<bits/stdc++.h>
using namespace std;

#define ll       long long int
#define ull      unsigned long long int
#define pb       push_back
#define vpop     pop_back
#define mp       make_pair
#define ff       first
#define ss       second
#define clz(x)   __builtin_clz(x)       //count leading zeroes
#define ctz(x)   __builtin_ctz(x)       //count trailing zeroes
#define sbts(x)  __builtin_popcount(x) //count set bits
#define ps(x, y) fixed << setprecision(y) << x
#define all(v)   v.begin(), v.end()
#define umap	 unordered_map
const int MOD  =  1e9 + 7;
const ll INF   =  1e12;
int n, k;
int memo[101][101][101];

int solve(string &str, int i, int N, int _max) {
    _max = max(N, _max);
    int &a = memo[i][N][_max];
    if(a != -1) return a;
    if(i == n)  return a = ((_max == k)? 1: 0);
    bool temp1 = solve(str, i+1, 0, _max);
    if(str[i] == 'Y' || temp1)   return a = temp1;
    return a = solve(str, i+1, N+1, _max);
}

int main() {
    ios_base::sync_with_stdio(false);   cin.tie(NULL);
    memset(memo, -1, sizeof(memo));
    cin >> n >> k;
    string str; cin >> str;
    cout << (solve(str, 0, 0, 0)? "YES": "NO");
    return 0;
}

#include <iostream>
#include <string>

using namespace std;

int main()
{
	int n, k;
	cin >> n >> k;

	string s;
	cin >> s;

	int cnt = 0;

	for (int i = 0; i < n; i++) {
		cnt = (s[i] == 'N') ? cnt + 1 : 0;
		if (cnt > k) {
			cout << "NO";
			return 0;
		}
	}

	for (int i = 0; i < n - k; i++) {
		bool is_cont_y = false;
		for (int j = 0; !is_cont_y && j < k; j++)
			is_cont_y = s[i + j] == 'Y';

		if (!is_cont_y) {
			cout << "YES";
			return 0;
		}
	}

	cout << "NO";
}

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#define MIN 1<<31-1
#define REP(i,n) for(int i = 0; i < (n); i++)
typedef long long int ll;
char NN[10000];
int zu[10000];
using namespace std;
int main()
{
	int n,k,l,r;
	cin>>n>>k;
	l=0;r=0;
	int flag=0;
	int nowl=0;
	int cou=0;
	for(int i=0;i<n;i++)
	{
		cin>>NN[i];
	}
	int i;
	for(i=0;i<n;i++)
	{
		if((NN[i]=='N'||NN[i]=='?')&&NN[i-1]!='N')
		{
			int w;
			for(w=1;w<k;w++)
				if(w+i>=n||NN[w+i]=='Y')
					break;
			if(w==k&&NN[i+w]!='N'||k==0)
			{
				break;
			}
		}
	}
	int out=0;
	if(i!=n)
		out=1;
	int mi=0;
	int nmi=0;
	for(i=0;i<n;i++)
	{
		if(NN[i]=='N')
		{
			nmi++;
		}
		else
		{
			mi=max(mi,nmi);
			nmi=0;
		}
	}
	mi=max(mi,nmi);
	if(out==1&&mi<=k)
		cout<<"YES";
	else
		cout<<"NO";
	return 0;
}

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#define MIN 1<<31-1
#define REP(i,n) for(int i = 0; i < (n); i++)
typedef long long int ll;
char NN[10000];
int zu[10000];
using namespace std;
int main()
{
	int n,k,l,r;
	cin>>n>>k;
	l=0;r=0;
	int flag=0;
	int nowl=0;
	int cou=0;
	for(int i=0;i<n;i++)
	{
		cin>>NN[i];
	}
	int i;
	for(i=0;i<n;i++)
	{
		if((NN[i]=='N'||NN[i]=='?')&&NN[i-1]!='N')
		{
			int w;
			for(w=1;w<k;w++)
				if(w+i>=n||NN[w+i]=='Y')
					break;
			if(w==k&&NN[i+w+1]!='N')
			{
				break;
			}
		}
	}
	int out=0;
	if(i!=n)
		out=1;
	int mi=0;
	int nmi=0;
	for(i=0;i<n;i++)
	{
		if(NN[i]=='N')
		{
			nmi++;
		}
		else
		{
			mi=max(mi,nmi);
			nmi=0;
		}
	}
	mi=max(mi,nmi);
	if(out==1&&mi<=k)
		cout<<"YES";
	else
		cout<<"NO";
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

const int N = 105;

char s[N];

bool dp[N][N][2];

bool solveDp(int ind,int cons,int g,int n,int k) {
    if(cons>k) {
        return false;
    }
    if(ind==n) {
        if(g) {
            return true;
        }
        else {
            return false;
        }
    }
    if(dp[ind][cons][g]) {
        return false;
    }
    dp[ind][cons][g] = true;
    if(s[ind]=='?') {
        int tmp = 0;
        int ng = g;
        if(tmp==k) {
            ng = 1;
        }
        if(solveDp(ind+1,tmp,ng,n,k) ){
            return true;
        }
        tmp = cons+1;
        ng = g;
        if(tmp==k) {
            ng = 1;
        }
        if(solveDp(ind+1,tmp,ng,n,k) ){
            return true;
        }
    }
    else if(s[ind]=='Y') {
        int tmp = 0;
        int ng = g;
        if(solveDp(ind+1,tmp,ng,n,k) ) {
            return true;
        }
    } else {
        int tmp = cons+1;
        int ng = g;
        if(tmp==k) {
            ng = 1;
        }
        if(solveDp(ind+1,tmp,ng,n,k) ) {
            return true;
        }
    }
    return false;
}

void solve() {
    int n,k;
    scanf("%d %d",&n,&k);
    scanf("%s",s);
    int g = 0;
    return;
    if(k==0) {
        g = 1;
    }
    if(solveDp(0,0,g,n,k)) {
        cout<<"YES\n";
    } else {
        cout<<"NO\n";
    }
}

int main()
{
    solve();
}

#include <bits/stdc++.h>
using namespace std;
int main() {
    int n,k; string s; cin>>n>>k>>s; bool flag = false;
    for(int i = k; i <= n; ++i) {
        string t = s;
        for(int j = 1; j <= i-k; ++j)
            if(t[j-1] == '?') t[j-1] = 'Y';
        for(int j = i; j <= n; ++j)
            if(t[j-1] == '?') t[j-1] = 'Y';
        for(int j = i-k+1; j <= i; ++j)
            if(t[j-1] == '?') t[j-1] = 'N';
        int c = 0, m = 0;
        for(int i = 1; i <= n; ++i) {
            if(t[i-1] == 'N') ++c;
            else {
                m = max(m,c);
                c = 0;
            }
        }
        m = max(m,c);
        if(m == k) {
            flag = true;
            break;
        }
    }
    if(flag) cout<<"YES\n";
    else cout<<"NO\n";
}

//
//  main.cpp
//  test
//
//  Created by Максим Бачурин on 04.02.17.
//  Copyright © 2017 Максим Бачурин. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
#include <set>
#include <map>
#include <list>
#include <queue>
#include <algorithm>
#include <iomanip>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> PII;
const ll mod = 1e9 + 7;
//const double eps = 1e-9;
const int inf = 1e9;
//const double PI = 3.1415926535897932384626433832795;
const int N = 40005;

int main()
{
    //freopen("output.txt", "r", stdin);
    //freopen("output2.txt", "w", stdout);
    ios_base::sync_with_stdio(0);
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    int t1 = 0, t2 = 0, maxn = 0, maxnv = 0;
    for(int i = 0; i < s.size(); i++)
    {
        if(s[i] == 'N')
        {
            t1++;
            t2++;
            maxn = max(maxn, t1);
            maxnv = max(maxnv, t2);
        }
        if(s[i] == '?')
        {
            //cout << t1 << endl;
            t1 = 0;
            t2++;
            maxnv = max(maxnv, t2);
            if(s[i+1]!='?')
            {
                t2 = 0;
            }
        }
        if(s[i] == 'Y')
        {
            //cout << t1 << endl;
            t1 = 0;
            t2 = 0;
        }
    }
    maxn = max(maxn, t1);
    maxnv = max(maxnv, t2);
    if(maxn <= k && k <= maxnv)
    {
        cout << "YES";
    }
    else
        cout << "NO";
    cout << endl;
    return 0;
}

#include <iostream>
#include <fstream>
#include <cstdio>
#include <queue>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <stack>
#include <cstring>
#include <cmath>

#define MN 1000010
#define INF 2147483647
#define PI 3.14159265359
#define pairr pair<int, int>
#define pairrr pair<int, pairr>
#define f first
#define s second
#define pb push_back
#define ll long long
#define MOD 10000007
#define IO ios_base::sync_with_stdio(false); cin.tie();
#define PQT pairr
#define PQL priority_queue<PQT, vector<PQT>, less<PQT> >
#define PQG priority_queue<PQT, vector<PQT>, greater<PQT> >

using namespace std;

int n,k,i,t,z,ans=-1;
string s;

int main()
{
    IO
//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);
    cin>>n>>k;
    cin>>s;
    for (i=0;i<s.length();i++)
    {
        if (s[i]=='Y')
        {
            if (t==k)
            {
                ans=1;
                break;
            }
            if (t>k)
            {
                ans=0;
                break;
            }
            t=0;
        }
        else
        if (s[i]=='N')
        {
            t++;
        }
    }
            if (t==k)
            {
                ans=1;
            }
            if (t>k) ans=0;
    if (ans==1) cout<<"YES\n";
    else
    if (ans==0) cout<<"NO\n";
    else
    {
        t=0;
        for (i=0;i<s.length();i++)
        {
            if (s[i]=='Y')
            {
                if (t+z>=k)
                {
                    ans=1;
                    break;
                }
                t=0;
                z=0;
            }
            else
            if (s[i]=='?')
            {
                z++;
            }
            else
            {
                t++;
            }
        }
        if (ans) cout<<"YES\n";
        else cout<<"NO\n";
    }
    return 0;
}

#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int main() {
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    int mx = 0, cur = 0;
    for (int i = 0; i < n; ++i) {
        if (s[i] != 'N') {
            mx = max(mx, cur);
            cur = 0;
        } else {
            ++cur;
        }
    }
    mx = max(mx, cur);
    if (mx > k) {
        cout << "NO\n";
        return 0;
    }
    int Y = 0;
    for (int i = 0; i < k; ++i) {
        Y += (s[i] == 'Y');
    }
    if (Y == 0) {
        cout << "YES\n";
        return 0;
    }
    for (int r = k; r < n; ++r) {
        if (s[r - k] == 'Y') {
            --Y;
        }
        if (s[r] == 'Y') {
            ++Y;
        }
        if (Y == 0) {
            cout << "YES\n";
            return 0;
        }
    }
    cout << "NO\n";
    return 0;
}

#include <iostream>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <bitset>
using namespace std;

#define in(s) freopen(s, "r", stdin);
#define out(s) freopen(s, "w", stdout);
#define forn(i, n) for (int i = 0; i < n; i++)
#define endl '\n'

typedef long long ll;
typedef long double ld;

int main()
{
	//in("cakes.in");
	//out("cakes.out");
	srand(1373737);
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int n, k;
	cin >> n >> k;

	string s;
	cin >> s;

	int p = 0, len = 0;
	while (p < s.size())
	{
		if (s[p] != 'N')
		{
			p++;
			continue;
		}
		int now = 0;
		while (p < s.size() && s[p] == 'N')
		{
			now++;
			p++;
		}
		len = max(len, now);
		if (now == k)
		{
			cout << "YES";
			return 0;
		}
	}
	if (len > k)
	{
		cout << "NO";
		return 0;
	}
	vector <bool> fix(n);
	forn(i, n)
	{
		if (s[i] == '?')
			s[i] = 'N';
		else
			fix[i] = true;
	}
	p = 0; len = 0;
	while (p < s.size())
	{
		if (s[p] != 'N')
		{
			p++;
			continue;
		}
		int now = 0, start = p;
		while (p < s.size() && s[p] == 'N')
		{
			now++;
			p++;
			if (now == k)
			{
				if ((start - 1 < 0 || !fix[start - 1]) && (p + 1 >= n || !fix[p + 1]))
				{
					cout << "YES";
					return 0;
				}
				else
				{
					now--;
					start++;
				}
			}
		}
	}
	cout << "NO";
	return 0;
}

#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define inf 0x3f3f3f3f
char a[250];
int main()
{
   int n,k;
   scanf("%d%d",&n,&k);
   getchar();
   for(int i=0;i<n;i++)
   {
       scanf("%c",&a[i]);
       a[i+n]=a[i];
   }
  // printf("%s",a);
   int p=1,kk,maxx=0;
   for(int i=0;i<2*n;i+=p)
   {
       if(a[i]=='N')
       {
           kk=0;
           for(int j=i;j<2*n;j++)
           {
               if(a[j]=='N')
               {
                    kk++;
               }
                else
                {
                    p=j-i;
                    break;
                }
           }
          // printf("%d\n",i);
           maxx=max(maxx,kk);
       }
   }
   if(maxx>k)
   printf("NO\n");
   else printf("YES\n");
}

#include <iostream>

using namespace std;

int main() {
    int n, k;
    cin >> n >> k;
    char c;
    int cnt1 = 0, cnt2 = 0;
    int cur1 = 0, cur2 = 0;
    for (int i = 0; i < n; i++){
        cin >> c;
        if (c == '?') {
            cur1++;
            cur2 = 0;
        }
        else if (c == 'N') {
            cur2++;
            cur1++;
        }
        else if (c == 'Y') {
            cur2 = 0;
            cur1 = 0;
        }
        cnt1 = max(cnt1, cur1);
        cnt2 = max(cnt2, cur2);
    }
    //cout << cnt1 << ' ' << cnt2 << '\n';
    if (cnt1 >= k && cnt2 <= k) {
        cout << "YES\n";
    } else {
        cout << "NO\n";
    }
}

#include <algorithm>
#include <vector>
#include <iostream>
#include <map>
#include <fstream>
#include <set>
#include <queue>
#include <cmath>
#define all(x) x.begin(), x.end()

using namespace std;
typedef long long ll;

int main() {
	cin.tie(0), cout.tie(0), ios_base::sync_with_stdio(0);
	string s;
	int n, k;
	cin >> n >> k >> s;
	s = s + '8';
	vector<int>pr(s.size() + 1, 0), pp(s.size() + 1, 0);
	for (int i = s.size() - 1; i >= 0; --i) {
		if (s[i] == 'N')pp[i] = pp[i + 1] + 1;
		if (s[i] != 'Y')pr[i] = pr[i + 1] + 1;
	}
	bool ok = 0;
	for (int i = 0; i < s.size(); ++i) {
		if (pr[i] >= k && s[i + k] != 'N') {
			if (i > 0 && s[i - 1] != 'N' || i == 0) {
				ok = 1;
				//cout << i << " " << pr[i]<<"\n";
			}
		}
	}
	for (int i = 0; i < s.size() - 1; i++) {
		if (pp[i] > k) {
			cout << "NO"; exit(0);
		}
	}
	if (ok)cout << "YES";
	else cout << "NO";
	return 0;
}/*
 0 7
 N??NN??NY

 */

#include <bits/stdc++.h>
#define maxn 110
using namespace std;

char a[maxn];
int f[maxn], g[maxn];
int n, m;
int ans;

int main()
{
	scanf("%d%d", &n, &m);
	gets(a + 1);
	gets(a + 1);

	if(m == 0)
	{
		for(int i = 1; i <= n; ++i)
		{
			if(a[i] == 'N')
			{
				printf("NO\n");
				return 0;
			}
		}
		//printf("YES\n");
		//return 0;
	}

	for(int i = 1; i <= n; ++i)
	{
		if(a[i] == 'N' && a[i - 1] != 'N')
		{
			f[i] = 1;
		}
	}
	/*
	for(int i = 1; i <= n; ++i)
		printf("%d ", f[i]);
	cout << endl;
	*/

	bool flag = false;
	for(int i = 1; i <= n; ++i)
	{
		if(a[i - 1] == a[i] && a[i] == 'N')
		{
			f[i] = f[i - 1] + 1;
		}
		if(f[i] == m && a[i + 1] != 'N')
		{
			flag = true;
		}
	}
	if(flag)
	{
		for(int i = 1; i <= n; ++i)
		{
			if(f[i] > m)
			{
				printf("NO\n");
				return 0;
			}
		}
		printf("YES\n");
		return 0;
	}

	//考虑有?的情况
	for(int i = 1; i <= n; ++i)
	{
		if(a[i] == 'Y')
			continue;
		int tem = (f[i] != 0) ? f[i] : 0;
		if(a[i] == '?')
		{
			tem++;
			if(tem == m && a[i + 1] != 'N')
			{
				printf("YES\n");
				return 0;
			}
		}
		if(a[i - 1] == '?')
		{
			int x = i - 1;
			while(a[x] == '?' || a[x] == 'N')
			{
				tem++;
				if(tem == m && a[x - 1] != 'N')
				{
					printf("Yes\n");
					return 0;
				}

				x--;
			}
		 }
		 if(a[i + 1] == '?')
		 {
		 	int y = i + 1;
		 	while(a[y] == '?' || a[y] == 'N')
		 	{
		 		tem++;
		 		if(tem == m && a[y + 1] != 'N')
		 		{
		 			printf("YES\n");
		 			return 0;
				 }

				 y++;
			 }
		 }
	}

	printf("NO\n");

	return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <map>
#include <algorithm>
#include <memory.h>

using namespace std;
long long MOD = 1000000007;
string go;
int sost[101][101];
int k;
int din (int pos, int least)
{
	if (sost[pos][least] != -1)
		return sost[pos][least];
	int ma = -1e9;
	if (pos == 0)
	{
		if (least == 1 && (go[0] == 'N' || go[0] == '?'))
			return 1;

		if (least == 0 && go[0] == 'N')
			return -1e9;

		return 0;
	}
	if (go[pos] == 'N' && least == 0)
		return -1e9;

	if (least == 0 && (go[pos] == '?' || go[pos] == 'Y'))
		ma = max(ma, din(pos - 1, k))+1;

	if (least != 0 && go[pos] == '?')
	{
		ma = max(ma, din(pos - 1, least - 1));
		ma = max(ma, din(pos - 1, k));
	}
	if (least != 0 && go[pos] == 'N')
	{
		ma = max(ma, din(pos - 1, least - 1));
	}
	if (go[pos] == 'Y')
	{
		ma = max(ma, din(pos - 1, k));
	}
	sost[pos][least] = ma;
	return ma;
}
int main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif
	int n;
	memset(sost, -1, sizeof(sost));
	cin >> n >> k;
	cin >> go;
	if (din(n - 1, k) > 0)
		puts("YES");
	else
		puts("NO");
	return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main(){

    int n,k;
    cin >> n >> k;

    string s;
    cin >> s;

    int sum[n+10] = {0};
    for(int i = 0;i<n;i++)sum[i+1] = sum[i] + (s[i] == 'N');

    int avl = 0;
    for(int i = 0;i<=(n-k-1);i++){
        int en = i+k+1,st = i;
        if((sum[en]-sum[st]) == (k+1)){
            avl = 1;
            break;
        }
    }

    if(avl == 1){
        cout << "NO" << endl;
        return 0;
    }
    for(int i = 0;i<n;i++)if(s[i] == '?')s[i] = 'N';
    sum[0] = 0;
    for(int i = 0;i<n;i++)sum[i+1]=sum[i] +( s[i]=='N');

    avl = 0;

    for(int i = 0;(i)<=(n-k);i++){
        int en = i + k,st = i;
        if((sum[en]-sum[i]) == k){avl = 1;break;}
    }
    if(avl == 1){
        cout << "YES" << endl;
    }
    else {
        cout << "NO" << endl;
    }

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

string s;

int main() {
 int n, k;
 cin >> n >> k >> s;
 s = "Y" + s + "Y";
queue<int> q; q.push(0); int d = 0; int mn = 0; int ok = 0;
 for(int i = 1; i <= n+1; i++) {
  while(q.size() && i - q.size() - 1 > k) q.pop();

  if(s[i] != 'N') {
   if(q.size() && i - q.size() - 1 == k) ok = 1;
   d = 0;
   q.push(i);
  }
  else mn = max(mn, ++d);
 }
 if(ok && mn <= k) cout << "YES" << endl;
 else cout << "NO" << endl;
}

#include <iostream>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <bitset>
using namespace std;

#define in(s) freopen(s, "r", stdin);
#define out(s) freopen(s, "w", stdout);
#define forn(i, n) for (int i = 0; i < n; i++)
#define endl '\n'

typedef long long ll;
typedef long double ld;

int main()
{
	//in("cakes.in");
	//out("cakes.out");
	srand(1373737);
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int n, k;
	cin >> n >> k;

	string s;
	cin >> s;

	int p = 0, len = 0;
	while (p < s.size())
	{
		if (s[p] != 'N')
		{
			p++;
			continue;
		}
		int now = 0;
		while (p < s.size() && s[p] == 'N')
		{
			now++;
			p++;
		}
		len = max(len, now);
	}
	if (len > k)
	{
		cout << "NO";
		return 0;
	}
	forn(i, n)
	{
		if (s[i] == '?')
			s[i] = 'N';
	}
	p = 0; len = 0;
	while (p < s.size())
	{
		if (s[p] != 'N')
		{
			p++;
			continue;
		}
		int now = 0;
		while (p < s.size() && s[p] == 'N')
		{
			now++;
			p++;
		}
		len = max(len, now);
	}
	if (len >= k)
	{
		cout << "YES";
	}
	else
	{
		cout << "NO";
	}
	return 0;
}

#include <stdio.h>
#include <bits/stdc++.h>

#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)

#define file ""

using namespace std;
using ll = long long;
using ull = unsigned long long;
using str = string;
using srt = short;

const int INF = (int)1e9 + 7;
const int mod = 998244353;
const ll inf = (ll)1e18;
const ull oo = 1000000000000001;
const int N = 200005;

signed main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	ios::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr); //freopen(file".in", "r", stdin); freopen(file".out", "w", stdout);

	int n, k;
	cin >> n >> k;
	str s;
	cin >> s;
	s = '#' + s + '#';
	int cnt = 0;
	for (int i = 1; i <= n; ++i)
	{
		if (s[i] == 'N')
			++cnt;
		else
			cnt = 0;
	}
	if (k < cnt || n < k)
	{
		cout << "NO";
	}
	else
	{
		for (int i = 1; i + k - 1 <= n; ++i)
		{
			bool ok = (s[i - 1] != 'N' && s[i + k] != 'N');
			for (int j = i; ok && j <= i + k - 1; ++j)
			{
				ok &= (s[j] != 'Y');
			}
			if (ok)
			{
				cout << "YES";
				return 0;
			}
		}
		cout << "NO";
	}
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define PI 3.1415926535
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef pair <ll, ll> pll;

bool check(string &s, ll k) {
    ll cnt = 0;
    for(auto i: s) {
        if(i == 'N') cnt++;
        else cnt = 0;
        if(cnt > k) return false;
    }
    return true;
}

int main(){
    ios_base:: sync_with_stdio(0);
    //start();
    ll n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    if(!check(s, k)) {
        cout << "NO";
        return 0;
    }
    for(ll i = 0; i < n; i++) {
        if(s[i] == '?' || s[i] == 'N') {
            ll cnt = 0;
            while(i + cnt < n && ((s[i + cnt] == '?' && cnt < k) || s[i + cnt] == 'N')) {
                cnt++;
            }
            //cout << cnt << endl;
            if(cnt == k) {
                cout << "YES";
                return 0;
            }
        }
    }
    cout << "NO";
    return 0;
}