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