#include <bits/stdc++.h>
using namespace std;
vector<char> line;
bool isPossible(int gLoc, int k);
int main() {
  int n, k;
  cin >> n;
  cin >> k;
  char curr;
  int grasshopperLocation;
  for (int i = 0; i < n; i++) {
    cin >> curr;
    line.push_back(curr);
    if (curr == 'G') grasshopperLocation = i;
  }
  if (isPossible(grasshopperLocation, k))
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
bool isPossible(int gLoc, int k) {
  for (int j = gLoc; j < line.size(); j += k) {
    if (line[j] == 'T')
      return true;
    else if (line[j] == '#')
      break;
  }
  for (int j = gLoc; j >= 0; j -= k) {
    if (line[j] == 'T')
      return true;
    else if (line[j] == '#')
      break;
  }
  return false;
}
