#include <bits/stdc++.h>
using namespace std;
long long int mul(long long int x, long long int y) {
  long long int ans = 1;
  while (y > 0) {
    if (y & 1) ans = (ans * x) % 1000000007;
    x = (x * x) % 1000000007;
    y /= 2;
  }
  return ans;
};
int main() {
  long long int n, k, i, a, b;
  cin >> n >> k;
  string str;
  cin >> str;
  for (i = 0; i < n; i++)
    if (str[i] == 'G') a = i;
  for (i = 0; i < n; i++)
    if (str[i] == 'T') b = i;
  if (a < b) {
    for (i = a + k; i < n; i += k)
      if (str[i] == '#') {
        cout << "NO";
        return 0;
      } else if (str[i] == 'T') {
        cout << "YES";
        return 0;
      } else
        continue;
    cout << "NO";
    return 0;
  } else {
    swap(a, b);
    for (i = a + k; i < n; i += k)
      if (str[i] == '#') {
        cout << "NO";
        return 0;
      } else if (str[i] == 'G') {
        cout << "YES";
        return 0;
      } else
        continue;
    cout << "NO";
    return 0;
  }
  return 0;
}
