#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100 + 5;
const int dir[2] = {-1, 1};
int N, K;
bool M[MAXN], vis[MAXN];
int G, T;
void input() {
  memset(M, true, sizeof(M));
  cin >> N >> K;
  getchar();
  for (int i = 0; i < N; i++) {
    char c = getchar();
    switch (c) {
      case 'G':
        G = i;
        break;
      case 'T':
        T = i;
        break;
      case '#':
        M[i] = false;
        break;
    }
  }
}
bool solve(int r) {
  vis[r] = true;
  if (G == r) return true;
  int cnt = 0;
  for (int d = 0; d < 2; d++) {
    int p = r + dir[d] * K;
    if (p >= 0 && p < N && M[p] && !vis[p] && solve(p))
      return true;
    else
      cnt++;
  }
  if (cnt >= 2) return false;
}
int main() {
  input();
  cout << (solve(T) ? "YES" : "NO") << endl;
  return 0;
}
