#include <bits/stdc++.h>
const double EPS = 1e-9;
const long long MOD = 1000000007;
const int INF = 2000 * 1000 * 1000;
const int MAX = 1005;
using namespace std;
int popcount(int n) {
  bitset<32> b(n);
  return b.count();
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) {
  long long temp = gcd(a, b);
  return temp ? (a / temp * b) : 0;
}
template <typename T>
T modpow(T base, T exp, T modulus) {
  base %= modulus;
  T result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % modulus;
    base = (base * base) % modulus;
    exp >>= 1;
  }
  return result;
}
inline bool isInteger(const std::string& s) {
  if (s.empty() || ((!isdigit(s[0])) && (s[0] != '-') && (s[0] != '+')))
    return false;
  char* p;
  strtol(s.c_str(), &p, 10);
  return (*p == 0);
}
int main() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  int idx1, idx2;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'G') idx1 = i;
    if (s[i] == 'T') idx2 = i;
  }
  if (idx2 < idx1) swap(idx1, idx2);
  for (int i = idx1 + k; i <= idx2; i += k) {
    if (s[i] == 'G' || s[i] == 'T') {
      cout << "YES" << endl;
      return 0;
    } else if (s[i] == '#') {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}
