#include <bits/stdc++.h>
using namespace std;
int n, k, g;
char a[1010];
bool can = 0;
void solve1() {
  int pos = g;
  while ((pos + k) < n) {
    pos += k;
    if (a[pos] == 'T') can = 1;
    if (a[pos] == '#') return;
  }
  while (pos >= 0) {
    pos -= k;
    if (a[pos] == 'T') can = 1;
    if (a[pos] == '#') return;
  }
}
void solve2() {
  int pos = g;
  while (pos >= 0) {
    pos -= k;
    if (a[pos] == 'T') can = 1;
    if (a[pos] == '#') return;
  }
  while ((pos + k) < n) {
    pos += k;
    if (a[pos] == 'T') can = 1;
    if (a[pos] == '#') return;
  }
}
int main(int argc, char* argv[]) {
  cin >> n >> k;
  scanf("%s", a);
  g = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == 'G') {
      g = i;
      break;
    }
  }
  solve1();
  solve2();
  if (can)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
