#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, j = 0;
  string s;
  cin >> n >> k >> s;
  while ((s[j] != 'G') && (s[j] != 'T')) {
    ++j;
  }
  j += k;
  while ((s[j] == '.') && (j < n)) {
    j += k;
  }
  if ((j >= n) || (s[j] == '#')) {
    cout << "NO";
  } else {
    cout << "YES";
  }
  return 0;
}
