#include <bits/stdc++.h>
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  char a[n];
  scanf("%s", a);
  int i, start, end;
  for (i = 0; i < n; i++) {
    if (a[i] == 'G') start = i;
    if (a[i] == 'T') end = i;
  }
  int sign = start - end;
  if (start > end) k = -k;
  while ((sign * (start - end)) > 0) {
    start = start + k;
    if (a[start] == '#') {
      printf("NO");
      break;
    }
    if (a[start] == 'T') {
      printf("YES");
      break;
    }
  }
  if (((sign * (start - end)) < 0) && (a[start] != '#')) printf("NO");
  return 0;
}
