#include <bits/stdc++.h>
using namespace std;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const long long linf = 4000000000000000000LL;
const long long inf = 1000000007;
const long double pi = 3.1415926535;
void pv(vector<int> a) {
  for (auto& x : a) cout << x << " ";
  cout << '\n';
}
void pv(vector<long long> a) {
  for (auto& x : a) cout << x << " ";
  cout << '\n';
}
void pv(vector<vector<int> > a) {
  for (int i = (0); i < (int(a.size())); ++i) {
    cout << i << '\n';
    pv(a[i]);
    cout << '\n';
  }
}
void pv(vector<vector<long long> > a) {
  for (int i = (0); i < (int(a.size())); ++i) {
    cout << i << '\n';
    pv(a[i]);
  }
  cout << '\n';
}
void pv(vector<string> a) {
  for (auto& x : a) cout << x << '\n';
  cout << '\n';
}
void setIO(string second) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  if (int(second.size())) {
    freopen((second + ".out").c_str(), "r", stdin);
    if (second != "test1") freopen((second + ".in").c_str(), "w", stdout);
  }
}
bool solve() {
  int n, a, b;
  string x;
  cin >> a >> b >> x;
  vector<int> c = {0};
  for (auto& y : x) {
    if (y == 'X')
      c.push_back(0);
    else {
      c.back()++;
    }
  }
  n = int(c.size());
  int type1 = 0, type2 = 0, type3 = 0, type4 = 0;
  int t = -1;
  for (auto& x : c) {
    if (x < b) {
      type1++;
    } else if (x >= b && x < a) {
      type2++;
    } else if (x >= a && x < 2 * b) {
      type3++;
    } else if (x >= 2 * b) {
      type4++;
      t = x;
    }
  }
  if (type2) return 0;
  if (type4 >= 2)
    return 0;
  else if (type4 == 1) {
    for (int i = (0); i < (t - a + 1); ++i) {
      int j = t - a;
      j -= i;
      int ntype3 = type3;
      if (j >= b && j < a) {
        continue;
      } else if (j >= 2 * b) {
        continue;
      } else if (j >= a && j < 2 * b) {
        ntype3++;
      }
      if (i >= b && i < a) {
        continue;
      } else if (i >= 2 * b) {
        continue;
      } else if (i >= a && i < 2 * b) {
        ntype3++;
      }
      if (ntype3 & 1) continue;
      return 1;
    }
    return 0;
  } else {
    return (type3 & 1);
  }
}
int main() {
  setIO("");
  int testc;
  cin >> testc;
  while (testc--) {
    cout << (solve() ? "YES" : "NO") << '\n';
  }
}
