#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const long long INF = 1e18;
int n, k, a, b;
char ch[110];
string s;
int main() {
  scanf("%d%d", &n, &k);
  scanf("%s", ch);
  s = ch;
  if (s.size() != n) return 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'G') a = i;
    if (s[i] == 'T') b = i;
  }
  if (a < b) {
    for (int i = a + k; i <= b; i += k) {
      if (s[i] == '#') {
        cout << "NO";
        return 0;
      }
      if (s[i] == 'T') {
        cout << "YES";
        return 0;
      }
    }
  } else {
    for (int i = a - k; i >= b; i -= k) {
      if (s[i] == '#') {
        cout << "NO";
        return 0;
      }
      if (s[i] == 'T') {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
