#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  char Map[100 + 10];
  scanf("%s", Map);
  int pos_G;
  for (int i = 0; i < n; i++) {
    if (Map[i] == 'G') {
      pos_G = i;
    }
  }
  bool flag = false;
  for (int i = pos_G; i < n; i += k) {
    if (Map[i] == '#') {
      break;
    }
    if (Map[i] == 'T') {
      flag = true;
    }
  }
  for (int i = pos_G; i >= 0; i -= k) {
    if (Map[i] == '#') {
      break;
    }
    if (Map[i] == 'T') {
      flag = true;
    }
  }
  if (flag) {
    printf("YES\n");
  } else
    printf("NO\n");
  return 0;
}
