#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110;
char s[MAXN];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  int ini = 0;
  for (int i = 0; i < n; i++) {
    scanf(" %c", &s[i]);
    if (s[i] == 'G') ini = i;
  }
  bool ok = false;
  int l = ini;
  while (l >= 0 && s[l] != '#') {
    if (s[l] == 'T') ok = true;
    l -= k;
  }
  l = ini;
  while (l < n && s[l] != '#') {
    if (s[l] == 'T') ok = true;
    l += k;
  }
  if (ok)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
