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 javafx.geometry.Side;

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

/**
 * Created by vishakha on 13-10-2016.
 */
public class Problem {
    public static boolean right = true;
    public static int ending;
    public static int initial;
    public static int[] start;
    public static int[] end;

    public static void main(String[] args) {
        getInput();
        ArrayList<Integer> listOfIndices = findIndices();

        System.out.println("YES");

        for (int i = listOfIndices.size() - 2; i >= 0; i--) {
//            System.out.println(listOfIndices.get(i - 1) + 1);
            int currIdx = listOfIndices.get(i) + 1;
            if (currIdx == listOfIndices.get(i + 1)) {
                continue;
            }

            int maxIdx = getLargestNum(start, currIdx, listOfIndices.get(i + 1));

            currIdx = maxIdx;
            int rightLimit = listOfIndices.get(i + 1);

            if (!right) {
                System.out.println(currIdx + 1 + " L");
                currIdx--;
                maxIdx--;
                rightLimit--;
                right = true;
            }

            while (currIdx < rightLimit) {
//                System.out.println(currIdx + " " + rightLimit);
                System.out.println(maxIdx + 1 + " R");
                currIdx++;
            }

            currIdx = maxIdx;
            while (currIdx > listOfIndices.get(i) + 1) {
//                System.out.println(currIdx + " " + listOfIndices.get(i) + 1);
                System.out.println(currIdx + 1 + " L");
                currIdx--;
            }

        }
//            System.out.println();
    }

    public static void getInput() {
        FastReader sc = new FastReader(System.in);
        initial = sc.nextInt();
        int sum = 0;
        start = new int[initial];
        boolean allEqual = true;

        for (int i = 0; i < initial; i++) {
            start[i] = sc.nextInt();
            sum += start[i];
            if (i != 0 && start[i] != start[i - 1] && allEqual) {
                allEqual = false;
            }
        }

        ending = sc.nextInt();
        int finalSum = 0;
        end = new int[ending];
        for (int i = 0; i < ending; i++) {
            end[i] = sc.nextInt();
            finalSum += end[i];
        }

        if (Arrays.equals(start, end)) {
            System.out.println("YES");
            System.exit(0);
        }

        if (finalSum !=  sum || allEqual) {
            System.out.print("NO");
//            System.out.println("whaaat");
            System.exit(0);
        }
    }

    public static ArrayList<Integer> findIndices() {
        int idx = 0;
        int prevIdx = -1;
        ArrayList<Integer> listOfIndices = new ArrayList<Integer>();
        listOfIndices.add(-1);

        for (int i = 0; i < ending; i++) {
            int curr = end[i];
            int currSum = 0;
            while (idx < initial) {
                currSum += start[idx];
                if (currSum == curr) {
                    if (prevIdx != idx - 1 && allSameInRange(start, prevIdx + 1, idx)) {
//                        System.out.println(prevIdx + " " + idx);
                        System.out.println("NO");
//                        System.out.println("haha1");
                        System.exit(0);
                    }
                    listOfIndices.add(idx);
                    prevIdx = idx;
                    idx++;
                    break;
                }
                idx++;
            }
            if (currSum != curr) {
//                System.out.println(currSum + " " + curr);
                System.out.println("NO");
//                System.out.println("haha2");
                System.exit(0);
            }
        }
        return  listOfIndices;
    }

    public static boolean allSameInRange(int[] a, int lo, int hi) {
        boolean ans = true;
        for (int i = lo + 1; i <= hi; i++) {
            if (a[i] != a[i - 1]) {
                ans = false;
                break;
            }
        }
        return ans;
    }

    public static int getLargestNum(int[] a, int lo, int hi) {
        int ans = lo;
        int max = a[lo];
        for (int i = lo + 1; i <= hi; i++) {
            if (a[i] >= max) {
                max = a[i];
                ans = i;
            }
        }
        if (ans == hi) {
            right = false;
            while (a[ans] == max) {
                ans--;
            }
            ans++;
        }
        return ans;
    }
}


class FastReader {
    private boolean finished = false;

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public FastReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }

        return buf[curChar++];
    }

    public int peek() {
        if (numChars == -1) {
            return -1;
        }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                return -1;
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c == ',') {
                c = read();
            }
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String nextString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        if (filter != null) {
            return filter.isSpaceChar(c);
        }
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuilder buf = new StringBuilder();
        int c = read();
        while (c != '\n' && c != -1) {
            if (c != '\r') {
                buf.appendCodePoint(c);
            }
            c = read();
        }
        return buf.toString();
    }

    public String nextLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String nextLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines) {
            return nextLine();
        } else {
            return readLine0();
        }
    }

    public BigInteger nextBigInteger() {
        try {
            return new BigInteger(nextString());
        } catch (NumberFormatException e) {
            throw new InputMismatchException();
        }
    }

    public char nextCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double nextDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E') {
                return res * Math.pow(10, nextInt());
            }
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E') {
                    return res * Math.pow(10, nextInt());
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public boolean isExhausted() {
        int value;
        while (isSpaceChar(value = peek()) && value != -1)
            read();
        return value == -1;
    }

    public String next() {
        return nextString();
    }

    public SpaceCharFilter getFilter() {
        return filter;
    }

    public void setFilter(SpaceCharFilter filter) {
        this.filter = filter;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}