#include <bits/stdc++.h>
using namespace std;
using namespace std;
bool IsPrime(long long int n) {
  for (long long int j = 2; j * j <= n; j += 1) {
    if (n % j == 0) {
      return 0;
    }
  }
  return 1;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  for (long long int i = 0; i < n; i++) {
    if (s[i] == 'G') {
      for (long long int j = i; j >= 0; j -= k) {
        if (s[j] == '#') break;
        if (s[j] == 'T') {
          cout << "YES" << endl;
          return 0;
        }
      }
      for (long long int j = i; j < n; j += k) {
        if (s[j] == '#') break;
        if (s[j] == 'T') {
          cout << "YES" << endl;
          return 0;
        }
      }
    }
  }
  cout << "NO\n" << endl;
  return 0;
}
