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