#include <bits/stdc++.h>
using namespace std;
int n, m, k, g, t;
long long sum = 0, c = 0;
vector<int> v;
string s, z;
int main() {
  cin >> n >> k;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'G')
      g = i;
    else if (s[i] == 'T')
      t = i;
  }
  m = g;
  while (g < n || m >= 0) {
    g += k;
    m -= k;
    if (g == t || m == t) {
      cout << "YES";
      return 0;
    }
    if (g < n && s[g] == '#') {
      g = n;
    }
    if (m >= 0 && s[m] == '#') {
      m = -1;
    }
  }
  cout << "NO";
  return 0;
}
