#include <bits/stdc++.h>
using namespace std;
int N, K, g, t;
char C[111];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> N >> K;
  for (int i = 0; i < N; i++) {
    cin >> C[i];
    if (C[i] == 'G') g = i;
    if (C[i] == 'T') t = i;
  }
  if (abs(g - t) % K) {
    printf("NO\n");
    return 0;
  }
  if (g > t) {
    for (int i = g; i > t; i -= K) {
      if (C[i] == '#') {
        printf("NO\n");
        return 0;
      }
    }
  } else {
    for (int i = g; i < t; i += K) {
      if (C[i] == '#') {
        printf("NO\n");
        return 0;
      }
    }
  }
  printf("YES\n");
}
