#include <bits/stdc++.h>
using namespace std;
void FLASH() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
void SETF() {
  cout.ios_base::setf(ios_base::fixed);
  cerr.ios_base::setf(ios_base::fixed);
}
void UNSETF() {
  cout.ios_base::unsetf(ios_base::fixed);
  cerr.ios_base::unsetf(ios_base::fixed);
}
bool sortinrev(const pair<long long int, long long int> &a,
               const pair<long long int, long long int> &b) {
  return (a.first > b.first);
}
long long int A[1000000];
long long int B[1000000];
map<int, vector<int> > node;
int main() {
  FLASH();
  long long int t;
  cin >> t;
  while (t--) {
    string s;
    long long int n;
    cin >> n >> s;
    if (n == 2) {
      if (s[0] >= s[1])
        cout << "NO" << endl;
      else
        cout << "YES" << endl << 2 << endl << s[0] << " " << s[1] << endl;
    } else {
      cout << "YES" << endl;
      cout << 2 << endl;
      cout << s[0] << " ";
      for (long long int i = 1; i < n; i++) cout << s[i];
      cout << endl;
    }
  }
  return 0;
}
