#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  string s;
  cin >> n >> k;
  cin >> s;
  for (int i = 0; i < n; i++)
    if (s[i] == 'G') {
      bool sw = 0;
      int ti = i;
      while (i < s.size()) {
        if (s[i] == 'T') sw = 1;
        if (s[i] == '#') break;
        i += k;
      }
      i = ti;
      while (i >= 0) {
        if (s[i] == 'T') sw = 1;
        if (s[i] == '#') break;
        i -= k;
      }
      cout << (sw ? "YES" : "NO");
      return 0;
    }
  return 0;
}
