#include <bits/stdc++.h>
using namespace std;
char s[103];
int abs(int x) {
  if (x > 0) return x;
  return -x;
}
int main() {
  int n = 0, k = 0;
  int pos = 0, mu = 0;
  cin >> n >> k;
  cin >> s;
  for (int i = 0; s[i]; i++) {
    if (s[i] == 'G')
      pos = i;
    else if (s[i] == 'T')
      mu = i;
  }
  int q = abs(pos - mu);
  if (q % k) {
    cout << "NO" << endl;
  } else {
    int jump = 0;
    if (pos > mu) {
      jump = -k;
    } else {
      jump = k;
    }
    for (int i = 1; i <= q; i++) {
      if (pos != mu && s[pos + jump] == '#') {
        cout << "NO" << endl;
        return 0;
      }
      pos += jump;
    }
    cout << "YES" << endl;
  }
  return 0;
}
