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:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class d {
    static  BufferedReader s = new BufferedReader(new InputStreamReader(System.in));;
    public static void main(String[] args) throws IOException {
        //      Scanner s = new Scanner(System.in);

        //       String[] st=s.readLine().trim().split("\\s+");
        //      a[i]=Integer.parseInt(st[i]);
        //      Integer.parseInt(s.readLine().trim().split("\\s+");
        StringBuilder sb = new StringBuilder();
        StringBuilder sbf = new StringBuilder();
        //  int n=Integer.parseInt(s.readLine().trim().split("\\s+")[0]);
     /*   String[] st=s.readLine().trim().split("\\s+");
        int n=Integer.parseInt(st[0]);*/
          String[] s1=si();
          int n=ic(s1[0]);
          String[] s2=si();
          long[] a=new long[n];
          for(int i=0;i<n;i++){
              a[i]=ic(s2[i]);
          }
          String[] s3=si();
          int m=ic(s3[0]);
          long[] b=new long[m];
          String[] s4=si();
          for(int i=0;i<m;i++){
              b[i]=ic(s4[i]);
          }long sum=0;int j=0;int flag=0;int x=0;
          for(int i=0;i<n;i++){sum=0;
              if(j==b.length) {flag=1;break;}
              int k=i;
              while(i<n&&sum!=b[j]){
                  sum+=a[i];i++;
              }
              if(i==n&&sum!=b[j]) {
                  flag=1;break;
              }else j++;
              i--;
       //       System.out.println("HI");
            /*  if(i==5){
                  System.out.println(sum+" "+i+" HI");
              }*/
            if(i==k){
                continue;
            }
         //     System.out.println(i+" "+k+" "+sum);
              long  max=0;int mi=-1;
              if(k+1<=i&&a[k+1]<max) mi=k;
                for(int l=k;l<=i;l++){
                    if(a[l]>max&&l<i&&a[l+1]<a[l]){
                        max=a[l];mi=l;
                    }else if(a[l]>max&&l>k&&a[l-1]<a[l]){
                        max=a[l];mi=l;
                    }
                }
                if(mi==-1){
                  //  System.out.println("HI");
                    flag=1;break;
                }
                int left=mi;int right=mi;
                if(left>k&&a[left-1]<a[left]){
                    while(left>k){
                        sb.append((left-x+1)+" L\n");left--;
                    }
                    while(right<i){
                        sb.append((left-x+1)+" R\n");right++;
                    }
                }else{
                    while(right<i){
                        sb.append((left-x+1)+" R\n");right++;
                    }
                    while(left>k){
                        sb.append((left-x+1)+" L\n");left--;
                    }
                }
           x+=(i-k);

          }if(flag==1||j<m){
            System.out.println("NO");
      //     System.out.println(sb.toString());
        }else{
            System.out.println("YES");
            System.out.println(sb.toString());
        }


    }
    static String[] si()throws  IOException{
        return s.readLine().trim().split("\\s+");
    }
    static int ic(String ss){
        return Integer.parseInt(ss);
    }
    static String lexographicallysmallest(String s) {
        if (s.length() % 2 == 1) return s;
        String s1 =lexographicallysmallest(s.substring(0, s.length()/2));
        String s2 = lexographicallysmallest(s.substring(s.length()/2, s.length()));
        if (s1.compareTo(s2)<0) return s1 + s2;
        else return s2 + s1;
    }
    public static int countSetBits(int n)
    {
        return (BitsSetTable256[n & 0xff]
                + BitsSetTable256[(n >> 8) & 0xff]
                + BitsSetTable256[(n >> 16) & 0xff]
                + BitsSetTable256[n >> 24]);
    }
    static int[] BitsSetTable256 ;
    public static void initialize(int n)
    {
        BitsSetTable256[0] = 0;
        for (int i = 0; i <=Math.pow(2,n); i++) {
            BitsSetTable256[i] = (i & 1) + BitsSetTable256[i / 2];
        }
    }
    static void dfs(int i,int val,ArrayList<Integer>[] adj){
    }

    static  void computeLPSArray(String pat, int M, int lps[]) {
        int len = 0;
        int i = 1;
        lps[0] = 0;
        while (i < M) {
            if (pat.charAt(i) == pat.charAt(len)) {
                len++;
                lps[i] = len;
                i++;
            }
            else
            {
                if (len != 0) {
                    len = lps[len - 1];
                }
                else
                {
                    lps[i] = len;
                    i++;
                }
            }
        }
    }
    static boolean isPrime(int n) {
        if (n <= 1) return false;
        if (n <= 3) return true;

        if (n % 2 == 0 || n % 3 == 0) return false;

        for (int i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
                return false;

        return true;
    }
    static long powerwithmod(long  x, long y, long p) {
        long  res = 1;
        x = x % p;
        while (y > 0) {
            if ((y & 1) == 1)
                res = (res * x) % p;
            y = y >> 1;
            x = (x * x) % p;
        }
        return res;
    }
    static long  powerwithoutmod(long x, int y) {
        long  temp;
        if( y == 0)
            return 1;
        temp = powerwithoutmod(x, y/2);
        if (y%2 == 0)
            return temp*temp;
        else
        {
            if(y > 0)
                return x * temp * temp;
            else
                return (temp * temp) / x;
        }
    }
    static void fracion(double x) {
        String a = "" + x;
        String spilts[] = a.split("\\."); // split using decimal
        int b = spilts[1].length(); // find the decimal length
        int denominator = (int) Math.pow(10, b); // calculate the denominator
        int numerator = (int) (x * denominator); // calculate the nerumrator Ex
        // 1.2*10 = 12
        int gcd = (int) gcd((long) numerator, denominator); // Find the greatest common
        // divisor bw them
        String fraction = "" + numerator / gcd + "/" + denominator / gcd;
        // System.out.println((denominator/gcd));
        long x1 = modInverse(denominator / gcd, 998244353);
        //  System.out.println(x1);
        System.out.println((((numerator / gcd) % 998244353 * (x1 % 998244353)) % 998244353));
    }
    static int bfs(int i1, ArrayList<Integer>[] h, int[] vis, int n,int val1) {
        Queue<Integer> q = new LinkedList<Integer>();
        q.add(i1);Queue<Integer> aq=new LinkedList<Integer>();
        aq.add(0);
        while(!q.isEmpty()){
            int i=q.poll();
            int val=aq.poll();
            if(i==n){
                return val;
            }
            if(h[i]!=null){
                for(Integer j:h[i]){
                    if(vis[j]==0){
                        q.add(j);vis[j]=1;
                        aq.add(val+1);}
                }
            }
        }return -1;
    }
    static long gcd(long a, long b) {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }
    static long modInverse(long a, long m)
    {
        return (powerwithmod(a, m - 2, m));
    }
    static int MAXN;
    static int[] spf;
    static void sieve() {
        spf[1] = 1;
        for (int i=2; i<MAXN; i++)
            spf[i] = i;
        for (int i=4; i<MAXN; i+=2)
            spf[i] = 2;
        for (int i=3; i*i<MAXN; i++)
        {
            if (spf[i] == i)
            {
                for (int j=i*i; j<MAXN; j+=i)

                    if (spf[j]==j)
                        spf[j] = i;
            }
        }
    }
    static ArrayList<Integer> getFactorizationUsingSeive(int x) {
        ArrayList<Integer> ret = new ArrayList<Integer>();
        while (x != 1)
        {
            ret.add(spf[x]);
            if(spf[x]!=0)   x = x / spf[x];
            else break;       }
        return ret;
    }
    static long[] fac ;
    static void calculatefac(long mod){
        fac[0]=1;
        for (int i = 1 ;i <= MAXN; i++)
            fac[i] = fac[i-1] * i % mod;
    }
    static long nCrModPFermat(int n, int r, long mod) {
        if (r == 0)
            return 1;
        fac[0] = 1;
        return (fac[n]*
                modInverse(fac[r], mod)
                % mod * modInverse(fac[n-r], mod)
                % mod) % mod;
    } }
class Student {
    int  l;long r;
    public Student(int l, long r) {
        this.l = l;
        this.r = r;
    }

    public String toString()
    {
        return this.l+" ";
    }
}
class Sortbyroll implements Comparator<Student>
{

    public int compare(Student a, Student b){
        if(a.r<b.r) return -1;
        else if(a.r==b.r){
            if(a.r==b.r){
                return 0;
            }
            if(a.r<b.r) return -1;
            return 1;}
        return 1;  }
}
class Sortbyroll2 implements Comparator<Student>
{

    public int compare(Student a, Student b){
        try{
            if(a.l*b.r<b.l*a.r) return 1;
            return -1;}
        catch (IllegalArgumentException e){
            System.out.println("HI");
        }
        return 9;}
}