#include <bits/stdc++.h>
using namespace std;
int n, k, G, T;
string s;
string solve() {
  for (int i = 0; i < s.size(); i++)
    if (s[i] == 'G') G = i;
  for (int i = 0; i < s.size(); i++)
    if (s[i] == 'T') T = i;
  if (G > T) swap(G, T);
  int i = 0;
  for (i = G; i < T; i += k) {
    if (s[i] == '#') return "NO";
  }
  return i == T ? "YES" : "NO";
}
int main() {
  cin >> n >> k;
  cin >> s;
  cout << solve() << endl;
  return 0;
}
