#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, a;
  cin >> n >> k;
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'G') a = i;
  }
  for (int i = a + k; i < s.size(); i += k) {
    if (s[i] == '#') break;
    if (s[i] == 'T') {
      cout << "YES";
      return 0;
    }
  }
  for (int i = a - k; i >= 0; i -= k) {
    if (s[i] == '#') break;
    if (s[i] == 'T') {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
