#include <bits/stdc++.h>
using namespace std;
const int NMAX = 100;
char str[NMAX + 1];
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k >> str;
  int startPosition, lastPosition;
  for (int i = 0; i < n; i++) {
    if (str[i] == 'G') {
      startPosition = i;
    } else if (str[i] == 'T') {
      lastPosition = i;
    }
  }
  if (startPosition > lastPosition) {
    while (startPosition > lastPosition and str[startPosition] != '#') {
      startPosition -= k;
    }
  } else {
    while (startPosition < lastPosition and str[startPosition] != '#') {
      startPosition += k;
    }
  }
  if (startPosition == lastPosition) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}
