#include <bits/stdc++.h>
int main() {
  int n, k, i, p, q, c, r;
  scanf("%d%d", &n, &k);
  char s[n + 1];
  scanf("%s", &s);
  for (i = 0; s[i] != '\0'; i++) {
    if (s[i] == 'G')
      p = i;
    else if (s[i] == 'T')
      q = i;
  }
  if (p < q) {
    c = 0;
    for (i = p; i <= q; i += k) {
      if (s[i] == '#')
        break;
      else if (s[i] == 'T') {
        c++;
        break;
      }
    }
  } else {
    c = 0;
    for (i = p; i >= q; i -= k) {
      if (s[i] == '#')
        break;
      else if (s[i] == 'T') {
        c++;
        break;
      }
    }
  }
  if (c == 0)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
