#include <bits/stdc++.h>
using namespace std;
int n, k;
string st;
int ins, hop;
int main() {
  cin >> n >> k;
  cin >> st;
  bool on = false, pos = true;
  for (int i = 0; i < n;) {
    if (on == true) {
      if (st[i] == '#') {
        pos = false;
        break;
      }
      if (st[i] == 'G' || st[i] == 'T') {
        on = false;
        break;
      }
      i += k;
    } else {
      if (st[i] == 'G' || st[i] == 'T') {
        on = true;
        i += k;
        continue;
      }
      i++;
    }
  }
  if (pos && on == false)
    cout << "YES\n";
  else
    cout << "NO\n";
}
