#include <bits/stdc++.h>
using namespace std;
char s[1234];
int main() {
  int n, m;
  while (~scanf("%d%d", &n, &m)) {
    scanf("%s", s);
    bool flag = false;
    int len = strlen(s), g, t;
    for (int i = 0; i < len; i++) {
      if (s[i] == 'G')
        g = i;
      else if (s[i] == 'T')
        t = i;
    }
    for (int i = g; i >= 0;) {
      if (s[i] == 'T')
        flag = true;
      else if (s[i] == '#')
        break;
      i -= m;
    }
    for (int i = g; i < len;) {
      if (s[i] == 'T')
        flag = true;
      else if (s[i] == '#')
        break;
      i += m;
    }
    if (flag)
      puts("YES");
    else
      puts("NO");
  }
}
