#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[1000];
  int n, k;
  cin >> n >> k;
  scanf("%s", s);
  int f, e;
  for (int i = 0; s[i]; i++)
    if (s[i] == 'G')
      f = i;
    else if (s[i] == 'T')
      e = i;
  bool flag = false;
  for (int i = f; i >= 0; i -= k) {
    if (s[i] == 'T') {
      flag = true;
      break;
    }
    if (s[i] == '#') break;
  }
  for (int i = f; i <= n - 1; i += k) {
    if (s[i] == 'T') {
      flag = true;
      break;
    }
    if (s[i] == '#') break;
  }
  if (flag)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
