Problem: Polycarp has 26 tasks. Each task is designated by a capital letter of the Latin alphabet.

The teacher asked Polycarp to solve tasks in the following way: if Polycarp began to solve some task, then he must solve it to the end, without being distracted by another task. After switching to another task, Polycarp cannot return to the previous task.

Polycarp can only solve one task during the day. Every day he wrote down what task he solved. Now the teacher wants to know if Polycarp followed his advice.

For example, if Polycarp solved tasks in the following order: "DDBBCCCBBEZ", then the teacher will see that on the third day Polycarp began to solve the task 'B', then on the fifth day he got distracted and began to solve the task 'C', on the eighth day Polycarp returned to the task 'B'. Other examples of when the teacher is suspicious: "BAB", "AABBCCDDEEBZZ" and "AAAAZAAAAA".

If Polycarp solved the tasks as follows: "FFGZZZY", then the teacher cannot have any suspicions. Please note that Polycarp is not obligated to solve all tasks. Other examples of when the teacher doesn't have any suspicious: "BA", "AFFFCC" and "YYYYY".

Help Polycarp find out if his teacher might be suspicious.

Input

The first line contains an integer t (1 ≤ t ≤ 1000). Then t test cases follow.

The first line of each test case contains one integer n (1 ≤ n ≤ 50) — the number of days during which Polycarp solved tasks.

The second line contains a string of length n, consisting of uppercase Latin letters, which is the order in which Polycarp solved the tasks.

Output

For each test case output: 

  * "YES", if the teacher cannot be suspicious; 
  * "NO", otherwise. 



You may print every letter in any case you want (so, for example, the strings yEs, yes, Yes and YES are all recognized as positive answer).

Example

Input


5
3
ABA
11
DDBBCCCBBEZ
7
FFGZZZY
1
Z
2
AB


Output


NO
NO
YES
YES
YES

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>

using namespace std;

//#pragma warning(disable:4996)
#define ff first
#define ss second
#define MP make_pair
#define mset(x,a) memset(x,a,sizeof(x))
#define max3(x,y,z) max(x,max(y,z))
#define min3(x,y,z) min(x,min(y,z))
#define sqr(a) (a)*(a)
#define all(x) (x).begin(), (x).end()
#define f(i, n) for (ll i = 0; i < n; ++i)
#define f1(i, n) for (ll i = 1; i <= n; ++i)
#define rep(i,a,b) for (ll i = a; i < b; ++i)
#define rep1(i,a,b) for (ll i = a ; i>=b;--i)
#define vvll vector<vector<ll>>  
#define vll vector<ll> 
#define pll pair<ll,ll>
#define vpll vector<pll>
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

bool sortinrev(ll x, ll y) { return x > y; }
void swap(ll* a, ll* b) { ll temp = *a; *a = *b; *b = temp; }
ll div_ceil(ll a, ll b) { return (a + b - 1) / b; }
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }


#define deb(a)			std::cerr<<#a<<"="<<(a)<<"\n"
#define deb2(a,b)		std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<"\n"
#define deb3(a,b,c)		std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<"\n"
const int MOD = 1000 * 1000 * 1000 + 7;
const ll INF = 1e18L + 5;

ll fpow(ll a, ll b) {
    if (b == 0) return 1;
    if (b % 2 == 1) { return fpow(a, b - 1) * a % MOD; }
    else { ll b2 = fpow(a, b / 2) % MOD; return b2 * b2 % MOD; }
}

bool isPalindrome(string str)
{
    ll l = 0;
    ll h = str.length() - 1;
    while (h > l)
    {
        if (str[l++] != str[h--])
        {
            return false;
        }
    }
    return true;
}

//syntax for priority queue
// max queue -> priority_queue<ll>
// min queue -> priority_queue<ll,vector<ll>,greater<ll>>

//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);

// for LARGEST SUM SUB-ARRAY PROBLEM use KADANE'S ALGORITHM 
//##############################################################################################
const int nax = 200005;

const int N = int(1e5) + 5;
//const int n = 505, m = 505;
////string s, t;

// TIME 12:35PM

void solve()
{
    ll n;
    cin >> n;
    string s;
    cin >> s;
    bool flag = 1;
    ll i = 0;
    unordered_set<char> st;
    while (i < n)
    {
        if (st.find(s[i]) != st.end())
        {
            flag = 0; break;
        }
        st.insert(s[i]);
        char c = s[i];
        while (i<n && s[i] == c)
            i++;
    }
    if (flag)
        cout << "YES\n";
    else
        cout << "NO\n";
}

//###############################################################################################

signed main()
{
    fast;
    
    ll t = 1;
    cin >> t;
    ll T = 1;
    //cout << fixed << setprecision(15);
    while (t--)
    {
        cerr << "TEST-CASE #" << T << "\n";
        solve(); T++;

        cerr << "\n";
    }
    cerr << "\nI am Winning";
    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";

}