#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, l, n, m;
  string second;
  cin >> n >> k >> second;
  i = 0;
  while (second[i] != 'G') i++;
  for (j = i + k; j < n; j += k)
    if (second[j] == '#')
      break;
    else if (second[j] == 'T') {
      cout << "YES\n";
      return 0;
    }
  for (j = i - k; j >= 0; j -= k)
    if (second[j] == '#')
      break;
    else if (second[j] == 'T') {
      cout << "YES\n";
      return 0;
    }
  cout << "NO\n";
  return 0;
}
