#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  queue<int> q;
  string s;
  cin >> s;
  vector<bool> f(n, 0);
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'G') {
      q.push(i);
      f[i] = 1;
    }
  }
  while (!q.empty()) {
    int fr = q.front();
    q.pop();
    int l = fr - m, r = fr + m;
    if (l >= 0 && (s[l] == '.' || s[l] == 'T') && !f[l]) {
      q.push(l);
      f[l] = 1;
    }
    if (r < n && (s[r] == '.' || s[r] == 'T') && !f[r]) {
      q.push(r);
      f[r] = 1;
    }
  }
  bool fl = false;
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'T' && f[i]) {
      fl = true;
      break;
    }
  }
  if (fl)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
