#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  bool cell[103];
  int g, t;
  char c;
  for (int i = 0; i < n; i++) {
    cin >> c;
    if (c == '#')
      cell[i] = false;
    else if (c == '.')
      cell[i] = true;
    else if (c == 'G')
      g = i;
    else if (c == 'T')
      t = i;
  }
  cell[t] = true;
  if (g < t) {
    while (g < t) {
      g += k;
      if (!cell[g]) {
        cout << "NO";
        return 0;
      }
    }
    if (g > t) cout << "NO";
    if (g == t) cout << "YES";
  } else if (g > t) {
    while (g > t) {
      g -= k;
      if (!cell[g]) {
        cout << "NO";
        return 0;
      }
    }
    if (g < t) cout << "NO";
    if (g == t) cout << "YES";
  }
}
