#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  char cells[102];
  cin >> n >> k >> cells;
  int start, end;
  for (int i = 0; i < n; ++i) {
    if (cells[i] == 'G')
      start = i;
    else if (cells[i] == 'T')
      end = i;
  }
  int delta = (start < end) ? k : -k;
  while (start >= 0 && start < n) {
    if (start == end) {
      cout << "YES" << endl;
      return 0;
    }
    if (cells[start] == '#') {
      cout << "NO" << endl;
      return 0;
    }
    start += delta;
  }
  cout << "NO" << endl;
}
