#include <bits/stdc++.h>
using namespace std;
char c[10000];
int main() {
  int n, k;
  cin >> n >> k;
  int pos1 = 0;
  int pos2 = 0;
  for (int i = 1; i <= n; i++) {
    cin >> c[i];
    if (c[i] == 'G') {
      pos1 = i;
    }
    if (c[i] == 'T') {
      pos2 = i;
    }
  }
  if (pos1 == pos2) {
    cout << "YES" << endl;
    return 0;
  }
  if (pos2 > pos1) {
    bool l = 0;
    while (pos1 != pos2 && pos1 <= n) {
      pos1 += k;
      if (c[pos1] == '#') {
        l = 0;
        break;
      } else if (pos1 == pos2) {
        l = 1;
      }
    }
    if (l) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  } else {
    bool l = 0;
    while (pos1 != pos2 && pos1 >= 1) {
      pos1 -= k;
      if (c[pos1] == '#') {
        l = 0;
        break;
      } else if (pos1 == pos2) {
        l = 1;
      }
    }
    if (l) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
