#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    string s;
    cin >> s;
    long long i;
    map<char, long long> mp;
    for (i = 0; i < n; i++) {
      mp[s[i]]++;
    }
    if (n == 2) {
      if (s[0] >= s[1]) {
        cout << "NO" << endl;
      } else {
        cout << "YES" << endl;
        cout << 2 << endl;
        cout << s[0] << " " << s.substr(1, n) << endl;
      }
    } else {
      cout << "YES" << endl;
      cout << 2 << endl;
      cout << s[0] << " " << s.substr(1, n) << endl;
    }
  }
}
