#include <bits/stdc++.h>
using namespace std;
struct FastIO {
  FastIO() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  }
} ____;
int n, k;
string s;
int main() {
  cin >> n >> k;
  string s;
  int st = 0;
  cin >> s;
  for (int i = 0; i < n; i++)
    if (s[i] == 'G' || s[i] == 'T') {
      for (int j = i + k; j < n; j += k) {
        if (s[j] == 'G' || s[j] == 'T') {
          cout << "YES\n";
          return 0;
        } else if (s[j] == '#') {
          cout << "NO\n";
          return 0;
        }
      }
      cout << "NO\n";
      return 0;
    }
  return 0;
}
