#include <bits/stdc++.h>
using namespace std;
template <class T>
using vec = vector<T>;
template <class T>
using v2d = vector<vector<T>>;
using ld = long double;
using ll = long long;
int main() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  vec<int> p;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'T' || s[i] == 'G') {
      p.push_back(i);
    }
  }
  int f1 = 0;
  int f2 = 1;
  for (int i = p[0]; i <= p[1]; i += k) {
    if (i == p[1]) {
      f1 = 1;
    }
    if (s[i] == '#') {
      f2 = 0;
    }
  }
  cout << (f1 && f2 ? "YES" : "NO") << '\n';
  return 0;
}
