#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using vll = vector<ll>;
using vii = vector<int>;
using pll = pair<ll, ll>;
using pii = pair<int, int>;
using ull = unsigned long long int;
ll To_int(string str) {
  stringstream ss(str);
  ll x = 0;
  ss >> x;
  return x;
}
template <typename T>
T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
template <typename T>
T lcm(T a, T b) {
  if (a < 0) return lcm(-a, b);
  if (b < 0) return lcm(a, -b);
  return a * (b / gcd(a, b));
}
void input() {}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t, tc;
  cin >> t;
  for (tc = 1; tc <= t; tc++) {
    int n;
    string s;
    cin >> n >> s;
    bool flag = true;
    if (n == 2) {
      if (s[0] == s[1] or s[0] > s[1])
        cout << "NO"
             << "\n";
      else {
        cout << "YES"
             << "\n";
        cout << 2 << "\n" << s[0] << " " << s[1] << "\n";
      }
    } else {
      cout << "YES"
           << "\n";
      cout << 2 << "\n" << s[0] << " ";
      for (int i = 1; i < n; i++) cout << s[i];
      cout << "\n";
    }
  }
  return 0;
}
