#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int vis[N];
int main() {
  int n, k, j;
  string s;
  cin >> n >> k >> s;
  for (int i = 0; i < int(int(s.size())); i++) {
    if (s[i] == 'G') j = i;
  }
  bool flag = 0;
  queue<int> q;
  q.push(j);
  vis[j] = 1;
  while (!q.empty()) {
    int t = q.front();
    q.pop();
    if (t - k >= 0 && !vis[t - k] && s[t - k] != '#') {
      int y = t - k;
      vis[y] = 1;
      if (s[y] == 'T') flag = 1;
      q.push(y);
    }
    if (t + k < n && !vis[t + k] && s[t + k] != '#') {
      int y = t + k;
      vis[y] = 1;
      if (s[y] == 'T') flag = 1;
      q.push(y);
    }
  }
  if (flag)
    puts("YES");
  else
    puts("NO");
  return 0;
}
