You are given an array of integers a of length n. The elements of the array can be either different or the same. 

Each element of the array is colored either blue or red. There are no unpainted elements in the array. One of the two operations described below can be applied to an array in a single step:

  * either you can select any blue element and decrease its value by 1; 
  * or you can select any red element and increase its value by 1. 



Situations in which there are no elements of some color at all are also possible. For example, if the whole array is colored blue or red, one of the operations becomes unavailable.

Determine whether it is possible to make 0 or more steps such that the resulting array is a permutation of numbers from 1 to n?

In other words, check whether there exists a sequence of steps (possibly empty) such that after applying it, the array a contains in some order all numbers from 1 to n (inclusive), each exactly once.

Input

The first line contains an integer t (1 ≤ t ≤ 10^4) — the number of input data sets in the test.

The description of each set of input data consists of three lines. The first line contains an integer n (1 ≤ n ≤ 2 ⋅ 10^5) — the length of the original array a. The second line contains n integers a_1, a_2, ..., a_n (-10^9 ≤ a_i ≤ 10^9) — the array elements themselves.

The third line has length n and consists exclusively of the letters 'B' and/or 'R': ith character is 'B' if a_i is colored blue, and is 'R' if colored red.

It is guaranteed that the sum of n over all input sets does not exceed 2 ⋅ 10^5.

Output

Print t lines, each of which contains the answer to the corresponding test case of the input. Print YES as an answer if the corresponding array can be transformed into a permutation, and NO otherwise.

You can print the answer in any case (for example, the strings yEs, yes, Yes, and YES will be recognized as a positive answer).

Example

Input


8
4
1 2 5 2
BRBR
2
1 1
BB
5
3 1 4 2 5
RBRRB
5
3 1 3 1 3
RBRRB
5
5 1 5 1 5
RBRRB
4
2 2 2 2
BRBR
2
1 -2
BR
4
-2 -1 4 0
RRRR


Output


YES
NO
YES
YES
NO
YES
YES
YES

Note

In the first test case of the example, the following sequence of moves can be performed:

  * choose i=3, element a_3=5 is blue, so we decrease it, we get a=[1,2,4,2]; 
  * choose i=2, element a_2=2 is red, so we increase it, we get a=[1,3,4,2]; 
  * choose i=3, element a_3=4 is blue, so we decrease it, we get a=[1,3,3,2]; 
  * choose i=2, element a_2=2 is red, so we increase it, we get a=[1,4,3,2]. 



We got that a is a permutation. Hence the answer is YES.
import java.util.*;
import java.lang.*;
import java.io.*;

public class Main
{
    static long mod = (int)1e9 + 7;
    static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
	public static void main (String[] args) throws java.lang.Exception
	{
		FastReader sc =new FastReader();
		
	    int t=sc.nextInt();
	    
	   // int t=1;
	    
	    outer :while(t-->0)
	    {
	        int n = sc.nextInt();
	        int arr[]  = sc.readArray(n);
	        char brr[] = sc.next().toCharArray();
	        ArrayList<Integer> red = new ArrayList<>();
	        ArrayList<Integer> blue = new ArrayList<>();
	        HashSet<Integer> set = new HashSet<>();
	        HashSet<Integer> red_set = new HashSet<>();
	        HashSet<Integer> blue_set = new HashSet<>();
	        
	        for(int i=0;i<n;i++)
	        {
	            if(brr[i] == 'R')
	            {
	                red.add(arr[i]);
	                red_set.add(arr[i]);
	            }
	            else
	            {
	                blue.add(arr[i]);
	                blue_set.add(arr[i]);
	            }
	            set.add(arr[i]);
	        }
	        Collections.sort(red);
	        Collections.sort(blue);
	        
	        
	        
	        if(blue.size()==0)
	        {
	            if(red.size() > 1 && red_set.size()==1)
	            {
	                if(red.get(0) > 1)
	                {
	                    out.println("NO");
	                    continue;
	                }
	            }
	        }
	        
	        if(red.size() == 0)
	        {
	            if(blue.size() > 1 && blue_set.size()==1)
	            {
	                if(blue.get(0) < 1)
	                {
	                    out.println("NO");
	                    continue;
	                }
	            }
	        }
	        boolean flag = true;
	        if(blue.size() > 0)
	        {
	            if(blue.get(0) >= 1)
    	        {
    	            blue.set(0 , 1);
    	        }
    	        else
    	        {
    	            out.println("NO");
    	            continue;
    	        }
    	        
	        }
	        
	        for(int i=1;i<blue.size();i++)
	        {
	            int ele = blue.get(i);
	            int prev = blue.get(i - 1);
	            if(ele != prev)
	            {
	                blue.set(i , (prev + 1));
	            }
	            else
	            {
	                flag = false;
	                break;
	            }
	        }
	        if(flag == false)
	        {
	            out.println("NO");
	        }
	        else
	        {
	            if(red.size() > 0)
	            {
    	            boolean z = true;
    	            int key = 0;
    	            if(blue.size() > 0)
    	            {
    	                key = blue.get(blue.size()-1);
    	            }
    	            if(red.get(0) >= (key + 2))
    	            {
    	                out.println("NO");
    	                continue outer;
    	            }
    	            else
    	            {
    	                red.set(0 , (key + 1));
    	            }
        	        for(int i=1;i<red.size();i++)
        	        {
        	            int ele = red.get(i);
        	            int prev = red.get(i - 1);
        	            if(ele >= (prev + 2))
        	            {
        	                z = false;
        	                break;
        	            }
        	            else
        	            {
        	                red.set(i , (prev + 1));
        	            }
        	            
        	        }
        	        if(z == false)
        	        {
        	            out.println("NO");
        	        }
        	        else
        	        {
        	            out.println("YES");
        	        }
    	        }
    	        else
    	        {
    	            out.println("YES");
    	        }
	        }
	    }
	    out.flush();
	}
	
	
	
	
	static class FastReader {
        BufferedReader br;
        StringTokenizer st;
 
        public FastReader()
        {
            br = new BufferedReader(
                new InputStreamReader(System.in));
        }
 
        String next()
        {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt() { return Integer.parseInt(next()); }
 
        long nextLong() { return Long.parseLong(next()); }
 
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
        
        float nextFloat()
        {
            return Float.parseFloat(next());
        }
 
        String nextLine()
        {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        
        int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		
		long[] readArrayLong(int n) {
			long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextLong();
			return a;
		}
		
    }
    
    
    
    public static int[] radixSort2(int[] a)
	{
		int n = a.length;
		int[] c0 = new int[0x101];
		int[] c1 = new int[0x101];
		int[] c2 = new int[0x101];
		int[] c3 = new int[0x101];
		for(int v : a) {
			c0[(v&0xff)+1]++;
			c1[(v>>>8&0xff)+1]++;
			c2[(v>>>16&0xff)+1]++;
			c3[(v>>>24^0x80)+1]++;
		}
		for(int i = 0;i < 0xff;i++) {
			c0[i+1] += c0[i];
			c1[i+1] += c1[i];
			c2[i+1] += c2[i];
			c3[i+1] += c3[i];
		}
		int[] t = new int[n];
		for(int v : a)t[c0[v&0xff]++] = v;
		for(int v : t)a[c1[v>>>8&0xff]++] = v;
		for(int v : a)t[c2[v>>>16&0xff]++] = v;
		for(int v : t)a[c3[v>>>24^0x80]++] = v;
		return a;
	}
	
	static void reverse_sorted(int[] arr)
	{
	    ArrayList<Integer> list = new ArrayList<>();
	    for(int i=0;i<arr.length;i++)
	    {
	        list.add(arr[i]);
	    }
	    Collections.sort(list , Collections.reverseOrder());
	    for(int i=0;i<arr.length;i++)
	    {
	        arr[i] = list.get(i);
	    }
	}
	
	static int LowerBound(int a[], int x) { // x is the target value or key
        int l=-1,r=a.length;
        while(l+1<r) {
            int m=(l+r)>>>1;
            if(a[m]>=x) r=m;
            else l=m;
        }
        return r;
    }
    
    static int UpperBound(ArrayList<Integer> list, int x) {// x is the key or target value
        int l=-1,r=list.size();
        while(l+1<r) {
            int m=(l+r)>>>1;
            if(list.get(m)<=x) l=m;
            else r=m;
        }
        return l+1;
    }
    
    public static HashMap<String, Integer> sortByValue(HashMap<String, Integer> hm)
    {
        // Create a list from elements of HashMap
        List<Map.Entry<String, Integer> > list =
               new LinkedList<Map.Entry<String, Integer> >(hm.entrySet());
 
        // Sort the list
        Collections.sort(list, new Comparator<Map.Entry<String, Integer> >() {
            public int compare(Map.Entry<String, Integer> o1,
                               Map.Entry<String, Integer> o2)
            {
                return (o1.getValue()).compareTo(o2.getValue());
            }
        });
         
        // put data from sorted list to hashmap
        HashMap<String, Integer> temp = new LinkedHashMap<String, Integer>();
        for (Map.Entry<String, Integer> aa : list) {
            temp.put(aa.getKey(), aa.getValue());
        }
        return temp;
    }
    
    static class Queue_Pair implements Comparable<Queue_Pair> {
		int first , second;
		public Queue_Pair(int first, int second) {
			this.first=first;
			this.second=second;
		}
		public int compareTo(Queue_Pair o) {
			return Integer.compare(o.first, first);
		}
	}
    
    static void leftRotate(char arr[], int d, int n)
    {
        for (int i = 0; i < d; i++)
            leftRotatebyOne(arr, n);
    }
 
    static void leftRotatebyOne(char arr[], int n)
    {
        int i;
        char temp = arr[0];
        for (i = 0; i < n - 1; i++)
            arr[i] = arr[i + 1];
        arr[n-1] = temp;
        
    }
    
    static void rightRotate(char arr[], int d, int n)
    {
        for (int i = 0; i < d; i++)
            rightRotatebyOne(arr, n);
    }
 
    static void rightRotatebyOne(char arr[], int n)
    {
        int i;
        char temp = arr[n - 1];
        for (i = n - 1; i > 0; i--)
            arr[i] = arr[i - 1];
        arr[0] = temp;
        
    }
    
    static boolean isPalindrome(String str)
    {
 
        // Pointers pointing to the beginning
        // and the end of the string
        int i = 0, j = str.length() - 1;
 
        // While there are characters to compare
        while (i < j) {
 
            // If there is a mismatch
            if (str.charAt(i) != str.charAt(j))
                return false;
 
            // Increment first pointer and
            // decrement the other
            i++;
            j--;
        }
 
        // Given string is a palindrome
        return true;
    }
    
    static boolean palindrome_array(char arr[], int n)
    {
        // Initialise flag to zero.
        int flag = 0;
 
        // Loop till array size n/2.
        for (int i = 0; i <= n / 2 && n != 0; i++) {
 
            // Check if first and last element are different
            // Then set flag to 1.
            if (arr[i] != arr[n - i - 1]) {
                flag = 1;
                break;
            }
        }
 
        // If flag is set then print Not Palindrome
        // else print Palindrome.
        if (flag == 1)
            return false;
        else
            return true;
    }
    
	static boolean allElementsEqual(long[] arr,int n)
	{
	    int z=0;
	        for(int i=0;i<n-1;i++)
		    {
		        if(arr[i]==arr[i+1])
		        {
		            z++;
		        }
		    }
		    if(z==n-1)
		    {
		        return true;
		    }
		    else
		    {
		        return false;
		    }
		    
	}
	
	static boolean allElementsDistinct(int[] arr,int n)
	{
	    int z=0;
	        for(int i=0;i<n-1;i++)
		    {
		        if(arr[i]!=arr[i+1])
		        {
		            z++;
		        }
		    }
		    if(z==n-1)
		    {
		        return true;
		    }
		    else
		    {
		        return false;
		    }
		    
		    
	}
	
	public static void reverse(int[] array)
    {
  
        // Length of the array
        int n = array.length;
  
        // Swaping the first half elements with last half
        // elements
        for (int i = 0; i < n / 2; i++) {
  
            // Storing the first half elements temporarily
            int temp = array[i];
  
            // Assigning the first half to the last half
            array[i] = array[n - i - 1];
  
            // Assigning the last half to the first half
            array[n - i - 1] = temp;
        }
    }
    
    public static void reverse_Long(long[] array)
    {
  
        // Length of the array
        int n = array.length;
  
        // Swaping the first half elements with last half
        // elements
        for (int i = 0; i < n / 2; i++) {
  
            // Storing the first half elements temporarily
            long temp = array[i];
  
            // Assigning the first half to the last half
            array[i] = array[n - i - 1];
  
            // Assigning the last half to the first half
            array[n - i - 1] = temp;
        }
    }
	
	static boolean isSorted(int[] a)
    {
        for (int i = 0; i < a.length - 1; i++)
        {
            if (a[i] > a[i + 1]) {
                return false;
            }
        }
 
        return true;
    }
    
    
    
    static boolean isReverseSorted(int[] a)
    {
        for (int i = 0; i < a.length - 1; i++)
        {
            if (a[i] < a[i + 1]) {
                return false;
            }
        }
 
        return true;
    }
    
    static int[] rearrangeEvenAndOdd(int arr[], int n)
    {
        ArrayList<Integer> list = new ArrayList<>();
		    
		    for(int i=0;i<n;i++)
		    {
		        if(arr[i]%2==0)
		        {
		            list.add(arr[i]);
		        }
		    }
		    
		    for(int i=0;i<n;i++)
		    {
		        if(arr[i]%2!=0)
		        {
		            list.add(arr[i]);
		        }
		    }
		    int len = list.size();
		    int[] array = list.stream().mapToInt(i->i).toArray();
		    return array;
    }
    
    static long[] rearrangeEvenAndOddLong(long arr[], int n)
    {
        ArrayList<Long> list = new ArrayList<>();
		    
		    for(int i=0;i<n;i++)
		    {
		        if(arr[i]%2==0)
		        {
		            list.add(arr[i]);
		        }
		    }
		    
		    for(int i=0;i<n;i++)
		    {
		        if(arr[i]%2!=0)
		        {
		            list.add(arr[i]);
		        }
		    }
		    int len = list.size();
		    long[] array = list.stream().mapToLong(i->i).toArray();
		    return array;
    }
	
	
    
    static boolean isPrime(long n)
    {
 
        // Check if number is less than
        // equal to 1
        if (n <= 1)
            return false;
 
        // Check if number is 2
        else if (n == 2)
            return true;
 
        // Check if n is a multiple of 2
        else if (n % 2 == 0)
            return false;
 
        // If not, then just check the odds
        for (long i = 3; i <= Math.sqrt(n); i += 2)
        {
            if (n % i == 0)
                return false;
        }
        return true;
    }
    
    static long getSum(long n)
    {    
        long sum = 0;
          
        while (n != 0)
        {
            sum = sum + n % 10;
            n = n/10;
        }
      
    return sum;
    }
    
    static int gcd(int a, int b)
    {
      if (b == 0)
        return a;
      return gcd(b, a % b);
    }
     
    static long gcdLong(long a, long b)
    {
        if (b == 0)
        return a;
      return gcdLong(b, a % b);
    }
    
    static void swap(int i, int j)
    {
        int temp = i;
        i = j;
        j = temp;
    }
	
	static int countDigit(int n)
    {
        return (int)Math.floor(Math.log10(n) + 1);
    }
	
}

class Pair
{
    int first , second;
    Pair(int first , int second)
    {
        this.first = first;
        this.second = second;
    }
}