#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  int s_len = s.length();
  int startp, targetp;
  for (int I = 0; I < s.length(); I += 1)
    if (s[I] == 'G') startp = I;
  for (int I = 0; I < s.length(); I += 1)
    if (s[I] == 'T') targetp = I;
  int Right = startp + k, Left = startp - k;
  bool exit1 = false, exit2 = false;
  while (true) {
    if (Right < s_len && s[Right] == '#') exit1 = true;
    if (Left >= 0 && s[Left] == '#') exit2 = true;
    if (exit1 && exit2) break;
    if ((Right == targetp && !exit1) || (Left == targetp && !exit2)) {
      cout << "YES";
      return 0;
    }
    Right += k;
    Left -= k;
    if (Right >= s_len && Left < 0) break;
  }
  cout << "NO";
}
