#include <bits/stdc++.h>
using namespace std;
int n, k, sx, ex;
char s[1010];
int main() {
  scanf("%d%d%s", &n, &k, s);
  for (int i = 0; i < n; i++) {
    if (s[i] == 'G') sx = i;
    if (s[i] == 'T') ex = i;
  }
  if (sx > ex) swap(sx, ex);
  if ((ex - sx) % k != 0)
    printf("NO\n");
  else {
    bool f = 1;
    for (int i = sx + k; i < ex; i += k) {
      if (s[i] == '#') f = 0;
    }
    if (f)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
