#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int main() {
  int n, k;
  string s;
  cin >> n >> k >> s;
  int start = 0;
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == 'G') start = i;
  }
  bool yes = false;
  for (int i = start; i < s.size(); i += k) {
    if (s[i] == 'T') yes = true;
    if (s[i] == '#') break;
  }
  for (int i = start; i >= 0; i -= k) {
    if (s[i] == 'T') yes = true;
    if (s[i] == '#') break;
  }
  if (yes)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
