#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b;
    cin >> a >> b;
    string s;
    cin >> s;
    bool only_b = false;
    int times2b = 0;
    bool grt4ba = false;
    int i = 0, j = 0;
    int z;
    s += 'X';
    for (char c : s) {
      if (c == 'X') {
        if (i >= b) j++;
        if (i < a && i >= b)
          only_b = true;
        else if (i >= (4 * b + a - 1))
          grt4ba = true;
        else if (i >= 2 * b)
          times2b++, z = i;
        else {
        }
        i = 0;
      } else {
        i++;
      }
    }
    if (grt4ba || only_b || times2b >= 2)
      cout << "no" << endl;
    else {
      if (times2b == 1) {
        j--;
        int h = 2 * b - a;
        h--;
        if (j % 2 == 1) {
          z = z - (2 * a);
          if (z >= 0 && z <= h + b - 1)
            cout << "yes" << endl;
          else
            cout << "no" << endl;
        } else {
          i = z - (3 * a);
          if (i >= 0 && i <= (2 * h))
            cout << "yes" << endl;
          else if ((z - a) >= 0 && (z - a) < (2 * b - 1))
            cout << "yes" << endl;
          else
            cout << "no" << endl;
        }
      }
      if (times2b == 0) {
        if (j % 2 == 1)
          cout << "yes" << endl;
        else
          cout << "no" << endl;
      }
    }
  }
  return 0;
}
