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.io.BufferedReader ;
	import java.io.IOException;
	import java.io.InputStreamReader;
	import java.util.ArrayList;
	import java.util.Arrays;
	import java.util.Random;
	import java.util.StringTokenizer;
	
	 
	public class A { 
		// author: Tarun Verma
		static FastScanner sc = new FastScanner();
		static int inf = Integer.MAX_VALUE;
		static int mod = 1000000007;
			
		public static class pair{
			int fr, sc, th;
		}
		
		public static void main(String[] args) {
			int t;
			t = 1;
			t =sc.nextInt();
			outer: for(int tt = 0;tt<t;tt++) {
				
				int n = sc.nextInt();
				String s = sc.next();
				int arr[] = new int[26];
				Arrays.fill(arr, -1);
				char last = s.charAt(0);
				arr[last - 'A'] = 1;
				for(int i = 1;i<n;i++) {
					if(s.charAt(i) == last) {
						arr[last - 'A'] ++;
					} else {
						last = s.charAt(i);
						if(arr[last - 'A'] != -1) {
							System.out.println("NO");
							continue outer;
						}
						arr[last - 'A'] = 1;
					}
				}
				System.out.println("YES");
				
			}
				
		}
		static boolean isPalindrom(char[] arr, int i, int j) {
			boolean ok = true;
			while(i<=j) {
				if(arr[i] != arr[j]) {
					ok = false;
					break;
				}
				i++;
				j--;
			}
			return ok;
		}
		static void printArr(int arr[]) {
			for(int i: arr) {
				System.out.print(i+" ");
			} System.out.println();
		}
		static int max(int a, int b) {return Math.max(a, b);}
		static int min(int a, int b) {return Math.min(a, b);}
		static int maxArr(int a[]) { 
			ruffleSort(a);
			return a[a.length - 1];
		}
		static int minArr(int a[]) { 
			ruffleSort(a);
			return a[0];
		}
		static void swap(int[] arr, int i, int j) {
			int temp = arr[i];
			arr[i] = arr[j];
			arr[j] = temp;
		}
		static long gcd(long a, long b) {
			if (b==0) return a;
			return gcd(b, a%b);
		}
		static void ruffleSort(int[] a) {
			int n=a.length;
			Random r=new Random();
			for (int i=0; i<a.length; i++) {
				int oi=r.nextInt(n); int temp=a[i];
				a[i]=a[oi];
				a[oi]=temp;
			}
			Arrays.sort(a);
		}
		public static int binarySearch(int a[], int target) {
			int left = 0;
			int right = a.length - 1;
			int mid = (left+ right) / 2;
			int i = 0;
			while(left <= right) {
				if(a[mid] <= target) {
					i = mid+1;
					left = mid + 1;
				} else {
					right = mid - 1;
				}
				mid = (left + right) / 2;
			}
			return i;
		}
		static class FastScanner {
			BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			StringTokenizer st=new StringTokenizer("");
			String next() {
				while (!st.hasMoreTokens())
					try {
						st=new StringTokenizer(br.readLine());
					} catch (IOException e) {
						e.printStackTrace();
					}
				return st.nextToken();
			}
			
			int nextInt() {
				return Integer.parseInt(next());
			}
			int[] readArray(int n) {
				int[] a=new int[n];
				for (int i=0; i<n; i++) a[i]=nextInt();
				return a;
			}
			int[][] read2dArray(int n, int m){
				int arr[][] = new int[n][m];
				for(int i= 0;i<n;i++) {
					for(int j = 0;j<m;j++) {
						arr[i][j] = nextInt();
					}
				}
				return arr;
			}
			
			ArrayList<Integer> readArrayList(int n){
				ArrayList<Integer> arr = new ArrayList<Integer>();
				for(int i = 0;i<n;i++) {
					int a = nextInt();
					arr.add(a);
				}
				return arr;
			}
			long nextLong() {
				return Long.parseLong(next());
			}
		}
		
		/*
		 * when you thing of giving up, think that other are hardworking!!!
		 */
	}