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