#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
char ch[maxn];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  scanf("%s", ch);
  int l = strlen(ch);
  int st, ed, temp;
  for (int i = 0; i < l; i++) {
    if (ch[i] == 'G') {
      st = i;
    } else if (ch[i] == 'T') {
      ed = i;
    }
  }
  if (st > ed) {
    swap(st, ed);
  }
  bool ans = 0;
  while (st < l) {
    st += k;
    if (ch[st] == '#') {
      ans = 0;
      break;
    } else if (st == ed) {
      ans = 1;
      break;
    }
  }
  ans ? puts("YES") : puts("NO");
  return 0;
}
