#include <bits/stdc++.h>
using namespace std;
bool visited[110] = {};
long long n, k;
char a[110];
void dfs(long long v) {
  if (v < 0 || v >= n || a[v] == '#') return;
  if (visited[v]) return;
  visited[v] = true;
  dfs(v + k);
  dfs(v - k);
}
int main() {
  cin >> n >> k;
  cin >> a;
  for (long long i = 0; i < n; i++)
    if (a[i] == 'G') dfs(i);
  for (long long i = 0; i < n; i++)
    if (a[i] == 'T') {
      if (visited[i])
        cout << "YES";
      else
        cout << "NO";
      return 0;
    }
  return 0;
}
