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