#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int i;
  int n;
  cin >> n;
  int k;
  cin >> k;
  char s[n];
  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 (t > g) {
    int flag = 1;
    i = g;
    while (i <= t) {
      if (s[i] == '#') {
        flag = 0;
        break;
      } else if (s[i] == 'T') {
        break;
      }
      i += k;
    }
    if (flag == 1 && i <= t)
      cout << "YES";
    else
      cout << "NO";
  } else if (t < g) {
    int flag = 1;
    i = g;
    while (i >= t) {
      if (s[i] == '#') {
        flag = 0;
        break;
      } else if (s[i] == 'T') {
        break;
      }
      i -= k;
    }
    if (flag == 1 && i >= t)
      cout << "YES";
    else
      cout << "NO";
  }
}
