#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(30);
  char st[10005];
  int x[105];
  int i, n, k, g, t;
  long long ans = 0;
  scanf("%d %d", &n, &k);
  scanf("%s", st);
  int len = strlen(st);
  for (i = 0; i < len; i++) {
    if (st[i] == 'G') g = i;
    if (st[i] == 'T') t = i;
  }
  int left = g;
  while (1) {
    left += k;
    if (left > len - 1 || st[left] == '#') {
      break;
    }
    if (left == t) {
      printf("YES\n");
      return 0;
    }
  }
  int right = g;
  while (1) {
    right -= k;
    if (right < 0 || st[right] == '#') {
      break;
    }
    if (right == t) {
      printf("YES\n");
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
