#include <bits/stdc++.h>
using namespace std;
const long long int INF = 0x7fffffff;
char __INPUT[25];
inline int _I() {
  scanf("%s", __INPUT);
  return atoi(__INPUT);
}
inline long long int _LLD() {
  scanf("%s", __INPUT);
  return atoll(__INPUT);
}
template <class T>
inline bool isPrimeNumber(T n) {
  if (n <= 1) return false;
  for (T i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
template <class T>
T gcd(T a, T b) {
  return b == 0 ? a : gcd(b, a % b);
}
template <typename T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
T power(T n, T p) {
  if (p == 0) return 1;
  T x = mpower(n, p / 2);
  x = (x * x);
  if (p & 1) x = (x * n);
  return x;
}
template <typename T>
string NumberToString(T Number) {
  ostringstream ss;
  ss << Number;
  return ss.str();
}
template <class T>
void print_vector(T &v) {
  int sz = v.size();
  if (sz) cout << v[0];
  for (int i = 1; i < sz; i++) cout << ' ' << v[i];
  cout << "\n";
}
template <class T>
inline T Mod(T n, T m) {
  return (n % m + m) % m;
}
int stringtonumber(string S) {
  int N = 1, X = S.size(), L = 1;
  N = S[0] - 48;
  while (L != X) {
    N = N * 10;
    N = N + (S[L] - 48);
    L++;
  }
  return N;
}
int Set(int N, int pos) { return N = N | (1 << pos); }
int reset(int N, int pos) { return N = N & ~(1 << pos); }
bool check(int N, int pos) { return (bool)(N & (1 << pos)); }
bool isUpperCase(char c) { return c >= 'A' && c <= 'Z'; }
bool isLowerCase(char c) { return c >= 'a' && c <= 'z'; }
bool isLetter(char c) { return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z'; }
bool isDigit(char c) { return c >= '0' && c <= '9'; }
bool isVowel(char c) {
  if (c == 'A' || c == 'a' || c == 'E' || c == 'e' || c == 'I' || c == 'i' ||
      c == 'O' || c == 'o' || c == 'U' || c == 'u' || c == 'Y' || c == 'y')
    return true;
  return false;
}
template <class T>
inline T bigmod(T p, T e, T M) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
bool compare(const pair<double, string> &i, const pair<double, string> &j) {
  return i.first < j.first;
}
int cases, cas = 0;
void CAS() { cases = _I(); }
void faltucode() {}
void letsGo() {
  int N = _I(), K = _I();
  string S;
  cin >> S;
  int G, T;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == 'G') {
      G = i;
    }
    if (S[i] == 'T') {
      T = i;
    }
  }
  if (abs(T - G) % K != 0) {
    cout << "NO" << endl;
    return;
  }
  for (int i = G; i <= T; i += K) {
    if (S[i] == '#') {
      cout << "NO" << endl;
      return;
    }
  }
  for (int i = G; i >= T; i -= K) {
    if (S[i] == '#') {
      cout << "NO" << endl;
      return;
    }
  }
  cout << "YES" << endl;
}
int main() {
  letsGo();
  return 0;
}
