#include <bits/stdc++.h>
using namespace std;
const long double pi = acosl(-1);
void solve() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  int coord_t, coord_g;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'G') coord_g = i;
    if (s[i] == 'T') coord_t = i;
  }
  int coord = coord_g;
  if (coord < coord_t) {
    while (coord < s.size()) {
      if (s[coord] == '#') break;
      if (coord == coord_t) {
        cout << "YES";
        return;
      }
      coord += k;
    }
  } else {
    coord = coord_g;
    while (coord >= 0) {
      if (s[coord] == '#') break;
      if (coord == coord_t) {
        cout << "YES";
        return;
      }
      coord -= k;
    }
  }
  cout << "NO";
  return;
}
int main() {
  solve();
  return 0;
}
