#include <bits/stdc++.h>
int main() {
  int n, k;
  std::cin >> n >> k;
  std::string s;
  std::cin >> s;
  int success = 0;
  int i = 0;
  while (s[i] != 'G') ++i;
  for (int j = i; j < n; j += k) {
    if (s[j] == '#') {
      break;
    }
    if (s[j] == 'T') {
      success = 1;
      break;
    }
  }
  std::reverse(s.begin(), s.end());
  i = 0;
  while (s[i] != 'G') ++i;
  for (int j = i; j < n; j += k) {
    if (s[j] == '#') {
      break;
    }
    if (s[j] == 'T') {
      success = 1;
      break;
    }
  }
  std::cout << (success ? "YES" : "NO") << std::endl;
  return 0;
}
