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 JAVA):

Solution:
import java.util.*;
import java.io.*;
public class Main {
    static Scanner in =new Scanner(System.in);
    static final Random random=new Random();
    static int mod=1000_000_007;
    static int []rank;
    static List<List<Integer>>adj;
    public static void main(String[] args) {
    int tt=in.nextInt();//in.nextLine();
           outer:while(tt-->0) {
               int n=in.nextInt();in.nextLine();
               char c[]=in.nextLine().toCharArray();
               int a[]=new int[27];Arrays.fill(a,-1);
               for(int i=0;i<n;i++){
                  int k= a[c[i]-'A'];
                   if(k!=-1 && k!=i-1){
                       System.out.println("NO");
                       continue outer;
                   }
                   a[c[i]-'A']=i;
               }
               System.out.println("YES");
       }
    }
    
    static long sum(long n){
        long res=0;
        while(n>0){
            res+=(n%10);n/=10;
        }
        return res;
    }
    static void uf (int[] root, int v1, int v2) {
            int rootP = find(v1,root);
            int rootQ = find(v2,root);
            if (rootP == rootQ) return;
            if (rank[rootQ] > rank[rootP]) {
                root[rootP] = rootQ;
                rank[rootQ]+=rank[rootP];
                rank[rootP]=0;
            }
            else {
                root[rootQ] = rootP;
                rank[rootP]+=rank[rootQ];
                rank[rootQ]=0;
            }
    }
    static int find(int p,int [] root) {
        	while (p != root[p]) {
               root[p] =root[root[p]];
                p = root[p];
            }
            return p;
        }
    static int nCr(int n,int r,int p){
        if (r == 0) return 1; 
        if(r==1)return n;
        return ((int)fact(n)*modInverse((int)fact(r),p)%p * modInverse((int)fact(n-r),p) % p)%p; 
    }
    static int modInverse(int n, int p){ 
        return power(n, p-2, p); 
    } 
    static int power(int x,int y,int p){ 
        int res = 1;
        x= x % p;
        while (y>0){
            if (y%2==1) 
                res= (res*x)% p;
            y= y >> 1;
            x= (x*x)% p; 
        }
        return res; 
    } 
    static void seive(){
        int num=1000001;
        boolean[] prime = new boolean[num];
        Arrays.fill(prime,true);
        for (int i=2; i*i<=num; i++) {
            if(prime[i] == true) {
                for(int j=i*i; j<num; j=j+i) {
                   prime[j]=false;
                }
            }
        }
    }
    static long[]readAr(int n) {
        long[] a=new long[(int)n];
        for (int i=0; i<n; i++) {a[i]=in.nextLong();}
        return a;
	}
    static int[]readA1r(int n) {
        int[] a=new int[(int)n];
        for (int i=0; i<n; i++) {a[i]=in.nextInt();}
        return a;
	}
    static int fact(int k){
        long[]f=new long[10001];f[1]=1;
        for(int i=2;i<10001;i++){
            f[i]=(i*f[i-1]% mod);
        }
        return (int)f[k];
    }
	static void ruffleSort(int[] a) {
		int n=a.length;
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
	static void reverse(int []a){
        int n= a.length;
        for(int i=0;i<n/2;i++){
            int temp=a[i];
            a[i]=a[n-i-1];
            a[n-i-1]=temp;
            a[i]=a[i];
        }
        //debug(a);
	}
	static void debug(int []a) {
        for (int i=0; i<a.length;i++) System.out.print(a[i]+" ");
        System.out.println();
	}
	static void print(List<Integer>s) {
        for(int x:s) System.out.print(x+",");
        System.out.println();
	}
	static long gcd(long a, long b) {
        return (b==0) ? a : gcd(b, a % b);
	}
    static long find_max(long []a){
        long m=Integer.MIN_VALUE;
        for(long x:a)m=Math.max(x,m);
        return m;
    }
    static int find_min(int []a){
        int m=Integer.MAX_VALUE;
        for(int x:a)m=Math.min(x,m);
        return m;
    }
}