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