Problem: There was an epidemic in Monstropolis and all monsters became sick. To recover, all monsters lined up in queue for an appointment to the only doctor in the city.

Soon, monsters became hungry and began to eat each other. 

One monster can eat other monster if its weight is strictly greater than the weight of the monster being eaten, and they stand in the queue next to each other. Monsters eat each other instantly. There are no monsters which are being eaten at the same moment. After the monster A eats the monster B, the weight of the monster A increases by the weight of the eaten monster B. In result of such eating the length of the queue decreases by one, all monsters after the eaten one step forward so that there is no empty places in the queue again. A monster can eat several monsters one after another. Initially there were n monsters in the queue, the i-th of which had weight ai.

For example, if weights are [1, 2, 2, 2, 1, 2] (in order of queue, monsters are numbered from 1 to 6 from left to right) then some of the options are:

  1. the first monster can't eat the second monster because a1 = 1 is not greater than a2 = 2; 
  2. the second monster can't eat the third monster because a2 = 2 is not greater than a3 = 2; 
  3. the second monster can't eat the fifth monster because they are not neighbors; 
  4. the second monster can eat the first monster, the queue will be transformed to [3, 2, 2, 1, 2]. 



After some time, someone said a good joke and all monsters recovered. At that moment there were k (k ≤ n) monsters in the queue, the j-th of which had weight bj. Both sequences (a and b) contain the weights of the monsters in the order from the first to the last.

You are required to provide one of the possible orders of eating monsters which led to the current queue, or to determine that this could not happen. Assume that the doctor didn't make any appointments while monsters were eating each other.

Input

The first line contains single integer n (1 ≤ n ≤ 500) — the number of monsters in the initial queue.

The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 106) — the initial weights of the monsters.

The third line contains single integer k (1 ≤ k ≤ n) — the number of monsters in the queue after the joke. 

The fourth line contains k integers b1, b2, ..., bk (1 ≤ bj ≤ 5·108) — the weights of the monsters after the joke. 

Monsters are listed in the order from the beginning of the queue to the end.

Output

In case if no actions could lead to the final queue, print "NO" (without quotes) in the only line. 

Otherwise print "YES" (without quotes) in the first line. In the next n - k lines print actions in the chronological order. In each line print x — the index number of the monster in the current queue which eats and, separated by space, the symbol 'L' if the monster which stays the x-th in the queue eats the monster in front of him, or 'R' if the monster which stays the x-th in the queue eats the monster behind him. After each eating the queue is enumerated again. 

When one monster eats another the queue decreases. If there are several answers, print any of them.

Examples

Input

6
1 2 2 2 1 2
2
5 5


Output

YES
2 L
1 R
4 L
3 L


Input

5
1 2 3 4 5
1
15


Output

YES
5 L
4 L
3 L
2 L


Input

5
1 1 1 3 3
3
2 1 6


Output

NO

Note

In the first example, initially there were n = 6 monsters, their weights are [1, 2, 2, 2, 1, 2] (in order of queue from the first monster to the last monster). The final queue should be [5, 5]. The following sequence of eatings leads to the final queue:

  * the second monster eats the monster to the left (i.e. the first monster), queue becomes [3, 2, 2, 1, 2]; 
  * the first monster (note, it was the second on the previous step) eats the monster to the right (i.e. the second monster), queue becomes [5, 2, 1, 2]; 
  * the fourth monster eats the mosnter to the left (i.e. the third monster), queue becomes [5, 2, 3]; 
  * the finally, the third monster eats the monster to the left (i.e. the second monster), queue becomes [5, 5]. 



Note that for each step the output contains numbers of the monsters in their current order in the queue.

Solution (in JAVA):

Solution:
/* "Why do we fall? So we can learn to pick ourselves up." */

import java.util.*;
import java.io.*;
import java.math.*;

public class Main

{ 
	 static FastReader sc=new FastReader(); 
	 
		  public static void main(String[] args) 
    {
			   PrintWriter out=new PrintWriter(System.out);
			   //StringBuffer sb=new StringBuffer("");
			  int ttt=1;
			     //ttt =i(); 
			     
		        outer :while (ttt-- > 0) 
				{
		        	int n=i();
		        	int A[]=input(n);
		        	int k=i();
		        	int B[]=input(k);
		        	int s1=0,s2=0;
		        	for(int i : A) {
		        		s1+=i;
		        	}
		        	for(int i : B) {
		        		s2+=i;
		        	}
		        	if(s1!=s2) {
		        		System.out.println("NO");
		        		return;
		        	}
		        	if(n==1) {
		        		System.out.println("YES");
		        		return;
		        	}
		        	int j=0;
		        	ArrayList<Integer> lt=new ArrayList<Integer>();
		        	for(int i : A)
		        		lt.add(i);
		        	Pair P[]=new Pair[k];
		        	
		        	for(int i=0;i<k;i++) {
		        		int y=B[i];
		        		int f=-1;
		        		int s=0;
		        		int l=j;
		        		for(;l<n;l++) {
		        			s+=A[l];

		        			if(s==y) {
		        				if(l-j==0)
		        					f=1;
		        				break;
		        			}
		        			if(s>y) {
		        				f=-1;
		        				break;
		        			}
		        			if(l+1<n) {
		        				if(A[l]!=A[l+1]) {
		        					f=1;
		        				}
		        			}
		        		}
		        		P[i]=new Pair(j, l);
		        		j=l+1;
		        		if(f==-1) {
		        			System.out.println("NO");
		        			return;
		        		}
		        		
		        	}
		        	System.out.println("YES");
		        	j=0;
		        	int pv=0;
		        	int u=0;
		        	while(u<k) {
		        		int y=B[u];
		        		int a=P[u].x;
		        		int b=P[u].y;
		        		int ind=-1;
		        		int max=0;
		        		int l=0;
		        		for(int i=a;i<=b;i++) {
		        			if(A[i]>max) {
		        				ind=i;
		        				max=A[i];
		        			}
		        			if(A[i]==max) {
		        				if(i-1>=a && A[i-1]!=max) {
		        				ind=i;
		        				l=1;
		        				}
		        				else if(i+1<=b && A[i+1]!=max) {
			        				ind=i;
			        				l=0;
			        				}
		        			}
		        		}
		        		int temp=ind;
		        		if(l==1) {
		        			while(ind>a) {
		        				out.println((ind-pv+1)+" L");
		        				ind--;
		        			}
		        			ind=temp;
		        			while(ind<b) {
		        				out.println((a-pv+1)+" R");
		        				ind++;
		        			}
		        		}
		        		else {
		        			while(ind<b) {
		        				out.println((temp-pv+1)+" R");
		        				ind++;
		        			}
		        			ind=temp;
		        			while(ind>a) {
		        				out.println((ind-pv+1)+" L");
		        				ind--;
		        			}
		        		}
		        		u++;
		        		pv+=b-a;
		        	}
		        	
		        	
		        	
		        	
		        	
//		        	while(lt.size()!=k) {
//		        		while(lt.get(j)!=B[j]) {
//		        			for(int i=0;i<lt.size();i++) {
//		        				
//		        			}
//		        		}
//		        	}
		        	
		        	
		        	
//		        	j=0;
//		        	int pv=0;
//		        	for(int o=0;o<k;o++) {
//		        		int y=B[o];
//		        		int s=0;
//		        		int i=j;
//		        		for(;i<n;i++) {
//		        			s+=A[i];
//		        			if(s==y) {
//		        				break;
//		        			}
//		        		}
//		        		int max=0;
//		        		int ind=-1;
//		        		for(int u=j;u<i;u++) {
//		        			if(A[u]>max) {
//		        				max=A[u];
//		        				ind=u;
//		        			}
//		        		}
//		        		while(ind-pv>0) {
//		        			
//		        		}
//		        		
//		        		
//		        		
//		        	}
//		        	
//		        	 
		        	
		        		        	
				}
			     out.close();
		    	//System.out.println(sb.toString());
		        	
    }
		 
		
static int[] input(int n) {
	int A[]=new int[n];
	   for(int i=0;i<n;i++) {
		   A[i]=sc.nextInt();
	   }
	   return A;
   }
static long[] inputL(int n) {
	long A[]=new long[n];
	   for(int i=0;i<n;i++) {
		   A[i]=sc.nextLong();
	   }
	   return A;
   }
static String[] inputS(int n) {
	String A[]=new String[n];
	   for(int i=0;i<n;i++) {
		   A[i]=sc.next();
	   }
	   return A;
   }
static long sum(int A[]) {
	long sum=0;
	for(int i : A) {
		sum+=i;
	}
	return sum;
}

static void input(int A[],int B[]) {
	   for(int i=0;i<A.length;i++) {
		   A[i]=sc.nextInt();
		   B[i]=sc.nextInt();
	   }
}
static int[][] input(int n,int m){
	int A[][]=new int[n][m];
	for(int i=0;i<n;i++) {
		for(int j=0;j<m;j++) {
			A[i][j]=i();
		}
	}
	return A;
}
static int max(int A[]) {
	int max=Integer.MIN_VALUE;
	for(int i=0;i<A.length;i++) {
		max=Math.max(max, A[i]);
	}
	return max;
}
static int min(int A[]) {
	int min=Integer.MAX_VALUE;
	for(int i=0;i<A.length;i++) {
		min=Math.min(min, A[i]);
	}
	return min;
}
static long max(long A[]) {
	long max=Long.MIN_VALUE;
	for(int i=0;i<A.length;i++) {
		max=Math.max(max, A[i]);
	}
	return max;
}
static long min(long A[]) {
	long min=Long.MAX_VALUE;
	for(int i=0;i<A.length;i++) {
		min=Math.min(min, A[i]);
	}
	return min;
}
static long mod(long x) {
	 int mod=1000000007;
	  return ((x%mod + mod)%mod);
}

     static int i() {
    	 return sc.nextInt();
     }
     static String s() {
    	 return sc.next();
     }
     static long l() {
    	 return sc.nextLong();
     }  
     static void sort(int[] A){
        int n = A.length;
        Random rnd = new Random();
        for(int i=0; i<n; ++i){
            int tmp = A[i];
            int randomPos = i + rnd.nextInt(n-i);
            A[i] = A[randomPos];
            A[randomPos] = tmp;
        }
        Arrays.sort(A);
     }
     static void sort(long[] A){
	        int n = A.length;
	        Random rnd = new Random();
	        for(int i=0; i<n; ++i){
	            long tmp = A[i];
	            int randomPos = i + rnd.nextInt(n-i);
	            A[i] = A[randomPos];
	            A[randomPos] = tmp;
	        }
	        Arrays.sort(A);
	     }
  static String sort(String s) {
 	 Character ch[]=new Character[s.length()];
 	 for(int i=0;i<s.length();i++) {
 		 ch[i]=s.charAt(i);
 	 }
 	 Arrays.sort(ch);
 	 StringBuffer st=new StringBuffer("");
 	 for(int i=0;i<s.length();i++) {
 		 st.append(ch[i]);
 	 }
 	 return st.toString();
  }
  static HashMap<Integer,Integer> hash(int A[]){
	  HashMap<Integer,Integer> map=new HashMap<Integer, Integer>();
	  for(int i : A) {
		  if(map.containsKey(i)) {
			  map.put(i, map.get(i)+1);
		  }
		  else {
			  map.put(i, 1);
		  }
	  }
	  return map;
  }
     static boolean prime(int n) 
	    { 
	        if (n <= 1) 
	            return false; 
	        if (n <= 3) 
	            return true; 
	        if (n % 2 == 0 || n % 3 == 0) 
	            return false; 
	        double sq=Math.sqrt(n);
	  
	        for (int i = 5; i <= sq; i = i + 6) 
	            if (n % i == 0 || n % (i + 2) == 0) 
	                return false; 
	        return true; 
	    } 
     static boolean prime(long n) 
	    { 
	        if (n <= 1) 
	            return false; 
	        if (n <= 3) 
	            return true; 
	        if (n % 2 == 0 || n % 3 == 0) 
	            return false; 
	        double sq=Math.sqrt(n);
	  
	        for (int i = 5; i <= sq; i = i + 6) 
	            if (n % i == 0 || n % (i + 2) == 0) 
	                return false; 
	        return true; 
	    } 
     static int gcd(int a, int b) 
     { 
         if (a == 0) 
             return b; 
         return gcd(b % a, a); 
     } 
     static long gcd(long a, long b) 
     { 
         if (a == 0) 
             return b; 
         return gcd(b % a, a); 
     } 
     static class Pair //implements Comparable<Pair>
     {
    	 int x;
    	 int y;
    	 Pair(int x,int y){
    		 this.x=x;
    		 this.y=y;
    	 }
     }
        
    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()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
}