#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  string input;
  cin >> input;
  int g_p, t_p;
  for (int i = 0; i < n; i++) {
    if (input[i] == 'G') {
      g_p = i;
    } else if (input[i] == 'T') {
      t_p = i;
    }
  }
  int first = g_p, second = g_p;
  bool marker = false;
  int i;
  for (i = first; i >= 0; i -= k) {
    if (input[i] == 'T') {
      printf("YES\n");
      return 0;
    } else if (input[i] == '#') {
      break;
    }
  }
  i = second;
  for (; i < n; i += k) {
    if (input[i] == 'T') {
      printf("YES\n");
      return 0;
    } else if (input[i] == '#') {
      break;
    }
  }
  printf("NO\n");
  return 0;
}
