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