#include <bits/stdc++.h>
using namespace std;
int n, k;
char ch[105];
int s, t;
int main() {
  cin >> n >> k;
  scanf("%s", ch + 1);
  for (int i = 1; i <= n; i++) {
    if (!s && (ch[i] == 'T' || ch[i] == 'G')) {
      s = i;
    }
    if (ch[i] == 'T' || ch[i] == 'G') {
      t = i;
    }
  }
  if ((t - s) % k != 0) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = s; i <= t; i += k) {
    if (ch[i] == '#') {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
