#include <bits/stdc++.h>
using namespace std;
char S[100005];
int main() {
  int N;
  int len, K;
  scanf("%d%d\n", &N, &K);
  gets(S);
  int grass, insect;
  for (int i = 0; i < N; i++) {
    if (S[i] == 'G')
      grass = i;
    else if (S[i] == 'T')
      insect = i;
  }
  if (grass > insect) swap(grass, insect);
  while (grass + K <= insect) {
    grass += K;
    if (S[grass] == '#') {
      printf("NO\n");
      return 0;
    } else if (grass == insect) {
      printf("YES\n");
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
