#include <bits/stdc++.h>
using namespace std;
void arr(string &s);
int main() {
  int n = 0, k = 0, m = 0;
  bool b = 0;
  cin >> n >> k;
  string s = "";
  cin >> s;
  arr(s);
  for (int i = 0; i < s.length(); i++) switch (s[i]) {
      case 'G':
        m = i;
        i = s.length();
        break;
    }
  for (int i = m; i < s.length(); i += k) switch (s[i]) {
      case 'T':
        b = 1;
        i = s.length();
        break;
      case '#':
        i = s.length();
        break;
    }
  switch (b) {
    case 1:
      cout << "YES\n";
      break;
    default:
      cout << "NO\n";
  }
}
void arr(string &s) {
  int a = 0, b = 0;
  string v = s;
  for (int i = 0; i < s.length(); i++) {
    switch (s[i]) {
      case 'G':
        a = i;
        break;
      case 'T':
        b = i;
        break;
    }
  }
  if (a > b) {
    for (int i = 1; i <= s.length(); i++) v[i - 1] = s[s.length() - i];
    s = v;
  }
}
