#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  char a[110];
  while (~scanf("%d%d", &n, &k)) {
    scanf("%s", a);
    int pos1, pos2, len = strlen(a);
    for (int i = 0; i < len; i++) {
      if (a[i] == 'G') pos1 = i;
      if (a[i] == 'T') pos2 = i;
    }
    if ((pos1 - pos2) % k == 0 || (pos2 - pos1) % k == 0) {
      int flag = 0;
      int maxx = max(pos1, pos2);
      int minn = min(pos1, pos2);
      for (int i = minn; i <= maxx; i = i + k) {
        if (a[i] == '#') flag = 1;
      }
      if (flag == 0)
        printf("YES\n");
      else
        printf("NO\n");
    } else
      printf("NO\n");
  }
  return 0;
}
