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.*;
import java.util.*;
import java.util.function.Function;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class C_378_div2
{
    private static BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
    private static StringTokenizer stringTokenizer = null;
    private static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

    private static String next() throws IOException
    {
        while ((stringTokenizer == null) || (!stringTokenizer.hasMoreTokens()))
        {
            stringTokenizer = new StringTokenizer(bufferedReader.readLine());
        }
        return stringTokenizer.nextToken();
    }

    public static int nextInt() throws IOException
    {
        return Integer.parseInt(next());
    }

    public static double nextDouble() throws IOException
    {
        return Double.parseDouble(next());
    }

    public static long nextLong() throws IOException
    {
        return Long.parseLong(next());
    }

    public static String nextLine() throws IOException
    {
        return bufferedReader.readLine();
    }

    public static void close()
    {
        out.close();
    }

    public static final long[] POWER2 = generatePOWER2();

    public static long divideCeil(long x, long y)
    {
        return x / y + (x % y == 0 ? 0 : 1);
    }

    public static long[] generatePOWER2()
    {
        long[] result = new long[63];
        for (int x = 0; x < result.length; x++)
        {
            result[x] = 1L << x;
        }
        return result;
    }

    interface BiFunctionResult<Type0, Type1, TypeResult>
    {
        TypeResult apply(Type0 x0, Type1 x1, TypeResult x2);
    }

    static abstract class Edge<TypeVertex extends Vertex<TypeVertex, TypeEdge>, TypeEdge extends Edge<TypeVertex, TypeEdge>>
    {
        public final TypeVertex vertex0;
        public final TypeVertex vertex1;

        public Edge(TypeVertex vertex0, TypeVertex vertex1, boolean bidirectional)
        {
            this.vertex0 = vertex0;
            this.vertex1 = vertex1;
            this.vertex0.edges.put(vertex1, getThis());
            if (bidirectional)
            {
                this.vertex1.edges.put(vertex0, getThis());
            }
        }

        private TypeVertex other(Vertex<TypeVertex, TypeEdge> vertex)
        {
            TypeVertex result;
            if (vertex0 == vertex)
            {
                result = vertex1;
            }
            else
            {
                result = vertex0;
            }
            return result;
        }

        public TypeVertex from(Vertex<TypeVertex, TypeEdge> to)
        {
            return other(to);
        }

        public TypeVertex to(Vertex<TypeVertex, TypeEdge> from)
        {
            return other(from);
        }

        public abstract TypeEdge getThis();
    }

    public static class Vertex<TypeVertex extends Vertex<TypeVertex, TypeEdge>, TypeEdge extends Edge<TypeVertex, TypeEdge>> implements Comparable<Vertex<? super TypeVertex, ? super TypeEdge>>
    {
        public final int index;
        public final Map<TypeVertex, TypeEdge> edges;

        public Vertex(int index)
        {
            this.index = index;
            this.edges = new TreeMap<>();
        }

        public static <TypeVertex extends Vertex<TypeVertex, TypeEdge>, TypeEdge extends Edge<TypeVertex, TypeEdge>, TypeResult> TypeResult depthFirstSearch(
                BiFunctionResult<TypeVertex, TypeEdge, TypeResult> function,
                TypeVertex vertex,
                TypeEdge edge,
                TypeResult result,
                boolean[] visited
        )
        {
            if (!visited[vertex.index])
            {
                visited[vertex.index] = true;
                result = function.apply(vertex, edge, result);
                for (Map.Entry<TypeVertex, TypeEdge> entry : vertex.edges.entrySet())
                {
                    TypeVertex vertexNext = entry.getKey();
                    TypeEdge edgeNext = entry.getValue();
                    result = depthFirstSearch(function, vertexNext, edgeNext, result, visited);
                }
            }
            return result;
        }

        public static <TypeVertex extends Vertex<TypeVertex, TypeEdge>, TypeEdge extends Edge<TypeVertex, TypeEdge>, TypeResult> TypeResult depthFirstSearch(
                TypeVertex[] vertices,
                int indexVertexStart,
                BiFunctionResult<TypeVertex, TypeEdge, TypeResult> function,
                TypeResult result
        )
        {
            boolean[] visited = new boolean[vertices.length];
            return depthFirstSearch(function, vertices[indexVertexStart], null, result, visited);
        }

        public static <TypeVertex extends Vertex<TypeVertex, TypeEdge>, TypeEdge extends Edge<TypeVertex, TypeEdge>, TypeResult> TypeResult breadthFirstSearch(
                TypeVertex[] vertices,
                int indexVertexStart,
                BiFunctionResult<TypeVertex, TypeEdge, TypeResult> function,
                TypeResult result
        )
        {
            boolean[] visited = new boolean[vertices.length];
            LIFO<TypeVertex> verticesNext = new LIFO<>();
            verticesNext.push(vertices[indexVertexStart]);
            LIFO<TypeEdge> edgesNext = new LIFO<>();
            edgesNext.push(null);
            while (!verticesNext.isEmpty())
            {
                TypeVertex vertex = verticesNext.pop();
                TypeEdge edge = edgesNext.pop();
                if (!visited[vertex.index])
                {
                    visited[vertex.index] = true;
                    result = function.apply(vertex, edge, result);
                    for (Map.Entry<TypeVertex, TypeEdge> entry : vertex.edges.entrySet())
                    {
                        TypeVertex vertexNext = entry.getKey();
                        TypeEdge edgeNext = entry.getValue();
                        if (!visited[vertexNext.index])
                        {
                            verticesNext.push(vertexNext);
                            edgesNext.push(edgeNext);
                        }
                    }
                }
            }
            return result;
        }

        @Override
        public int compareTo(Vertex<? super TypeVertex, ? super TypeEdge> that)
        {
            return that.index - this.index;
        }
    }

    public static class Tuple2<Type0, Type1>
    {
        public final Type0 v0;
        public final Type1 v1;

        public Tuple2(Type0 v0, Type1 v1)
        {
            this.v0 = v0;
            this.v1 = v1;
        }
    }

    public static class Tuple2Comparable<Type0 extends Comparable<? super Type0>, Type1 extends Comparable<? super Type1>> extends Tuple2<Type0, Type1> implements Comparable<Tuple2Comparable<Type0, Type1>>
    {
        public Tuple2Comparable(Type0 v0, Type1 v1)
        {
            super(v0, v1);
        }

        @Override
        public int compareTo(Tuple2Comparable<Type0, Type1> that)
        {
            int result = this.v0.compareTo(that.v0);
            if (result == 0)
            {
                result = this.v1.compareTo(that.v1);
            }
            return result;
        }
    }

    public static class SingleLinkedList<Type>
    {
        public final Type element;
        public SingleLinkedList<Type> next;

        public SingleLinkedList(Type element, SingleLinkedList<Type> next)
        {
            this.element = element;
            this.next = next;
        }

        public void toCollection(Collection<Type> collection)
        {
            if (this.next != null)
            {
                this.next.toCollection(collection);
            }
            collection.add(this.element);
        }
    }

    public static class LIFO<Type>
    {
        public SingleLinkedList<Type> start;
        public SingleLinkedList<Type> end;

        public LIFO()
        {
            this.start = null;
            this.end = null;
        }

        public void push(Type element)
        {
            SingleLinkedList<Type> list = new SingleLinkedList<>(element, null);
            if (this.start == null)
            {
                this.start = list;
                this.end = list;
            }
            else
            {
                this.end.next = list;
                this.end = list;
            }
        }

        public Type pop()
        {
            Type result = this.start.element;
            this.start = this.start.next;
            return result;
        }

        public boolean isEmpty()
        {
            return this.start == null;
        }
    }

    public static class MapCount extends TreeMap<Long, Long>
    {
        private int size;

        public MapCount()
        {
            this.size = 0;
        }

        public MapCount(Comparator<? super Long> comparator)
        {
            super(comparator);
        }

        public long add(Long key, Long delta)
        {
            long result;
            if (delta > 0)
            {
                Long value = get(key);
                if (value == null)
                {
                    value = delta;
                }
                else
                {
                    value += delta;
                }
                put(key, value);
                result = delta;
            }
            else
            {
                result = 0;
            }
            this.size += result;
            return result;
        }

        public long remove(Long key, Long delta)
        {
            long result;
            if (delta > 0)
            {
                Long value = get(key) - delta;
                if (value <= 0)
                {
                    result = delta + value;
                    remove(key);
                }
                else
                {
                    result = delta;
                    put(key, value);
                }
            }
            else
            {
                result = 0;
            }
            this.size -= result;
            return result;
        }

        public int size()
        {
            return this.size;
        }
    }

    public static class MapSet<TypeKey extends Comparable<? super TypeKey>, TypeValue extends Comparable<? super TypeValue>> extends TreeMap<TypeKey, TreeSet<TypeValue>> implements Iterable<TypeValue>
    {
        private int size;

        public MapSet()
        {
            this.size = 0;
        }

        public TypeValue firstValue()
        {
            TypeValue result;
            Map.Entry<TypeKey, TreeSet<TypeValue>> firstEntry = firstEntry();
            if (firstEntry == null)
            {
                result = null;
            }
            else
            {
                result = firstEntry.getValue().first();
            }
            return result;
        }

        public Iterator<TypeValue> iterator()
        {
            return new Iterator<TypeValue>()
            {
                Iterator<TreeSet<TypeValue>> iteratorValues = values().iterator();
                Iterator<TypeValue> iteratorValue = null;

                @Override
                public boolean hasNext()
                {
                    return iteratorValues.hasNext() || (iteratorValue != null && iteratorValue.hasNext());
                }

                @Override
                public TypeValue next()
                {
                    if (iteratorValue == null || !iteratorValue.hasNext())
                    {
                        iteratorValue = iteratorValues.next().iterator();
                    }
                    return iteratorValue.next();
                }
            };
        }

        public TypeValue lastValue()
        {
            TypeValue result;
            Map.Entry<TypeKey, TreeSet<TypeValue>> lastEntry = lastEntry();
            if (lastEntry == null)
            {
                result = null;
            }
            else
            {
                result = lastEntry.getValue().last();
            }
            return result;
        }

        public boolean put(TypeKey key, TypeValue value)
        {
            TreeSet<TypeValue> set = get(key);
            if (set == null)
            {
                set = new TreeSet<TypeValue>();
                put(key, set);
            }
            boolean result = set.add(value);
            if (result)
            {
                this.size += 1;
            }
            return result;
        }

        public boolean remove(TypeKey key, TypeValue value)
        {
            boolean result;
            TreeSet<TypeValue> set = get(key);
            if (set == null)
            {
                result = false;
            }
            else
            {
                result = set.remove(value);
                if (set.size() == 0)
                {
                    remove(key);
                }
                if (result)
                {
                    this.size -= 1;
                }
            }
            return result;
        }

        @Override
        public int size()
        {
            return this.size;
        }
    }

    public static int binarySearchMinimum(Function<Integer, Boolean> filter, int start, int end)
    {
        int result;
        if (start == end)
        {
            result = end;
        }
        else
        {
            int middle = start + (end - start) / 2;
            if (filter.apply(middle))
            {
                result = binarySearchMinimum(filter, start, middle);
            }
            else
            {
                result = binarySearchMinimum(filter, middle + 1, end);
            }
        }
        return result;
    }

    public static int binarySearchMaximum(Function<Integer, Boolean> filter, int start, int end)
    {
        return -binarySearchMinimum(x -> filter.apply(-x), -end, -start);
    }

    public static long faculty(int n)
    {
        long result = 1;
        for (int index = 2; index <= n; index++)
        {
            result *= index;
        }
        return result;
    }

    public static <T> List<T> permutation(long p, List<T> x)
    {
        List<T> copy = new ArrayList<>();
        for (int index = 0; index < x.size(); index++)
        {
            copy.add(x.get(index));
        }
        List<T> result = new ArrayList<>();
        for (int indexTo = 0; indexTo < x.size(); indexTo++)
        {
            int indexFrom = (int) p % copy.size();
            p = p / copy.size();
            result.add(copy.remove(indexFrom));
        }
        return result;
    }

    public static <Type> void println(Iterable<Type> iterable)
    {
        Iterator<Type> iterator = iterable.iterator();
        if (iterator.hasNext())
        {
            out.print(iterator.next());
        }
        while (iterator.hasNext())
        {
            out.print(" " + iterator.next());
        }
        out.println();
    }

    public static <Type> void println(Type[] array)
    {
        println(Arrays.asList(array));
    }

    public static void main(String[] args)
    {
        try
        {
            solve();
        } catch (IOException exception)
        {
            exception.printStackTrace();
        }
        close();
    }


    public static void eat(List<Integer> monsters, int index)
    {
        monsters.set(index, monsters.get(index) + monsters.get(index + 1));
        monsters.remove(index + 1);
    }

    public static StringBuffer eat(List<Integer> monsters, int offset, StringBuffer stringBuffer)
    {
        StringBuffer result;
        int weightMaximum = monsters.stream()
                .reduce(0, (x, y) -> Math.max(x, y));
        boolean changed = true;
        while (changed)
        {
            changed = false;
            for (int index = 0; index < monsters.size() - 1; index++)
            {
                if (weightMaximum == monsters.get(index + 1) && monsters.get(index) < monsters.get(index + 1))
                {
                    stringBuffer.append((offset + index + 1 + 1) + " L\n");
                    eat(monsters, index);
                    weightMaximum = monsters.get(index);
                    changed = true;
                }
                else
                {
                    if (weightMaximum == monsters.get(index) && monsters.get(index + 1) < monsters.get(index))
                    {
                        stringBuffer.append((offset + index + 1) + " R\n");
                        eat(monsters, index);
                        weightMaximum = monsters.get(index);
                        changed = true;
                    }
                }
            }
        }
        if (monsters.size() == 1)
        {
            result = stringBuffer;
        }
        else
        {
            result = null;
        }
        return result;
    }


    public static Integer monsterCount(List<Integer> a, int index, int sum)
    {
        for (; sum > 0 && index < a.size(); index++)
        {
            sum -= a.get(index);
        }
        Integer result;
        if (sum == 0)
        {
            result = index;
        }
        else
        {
            result = null;
        }
        return result;
    }

    public static StringBuffer eat(int[] a, int[] b)
    {
        List<Integer> list = new ArrayList<>();
        IntStream
                .of(a)
                .forEach(x -> list.add(x));
        StringBuffer result = new StringBuffer();
        for (int index = 0; result != null && index < b.length; index++)
        {
            Integer end = monsterCount(list, index, b[index]);
            if (end != null)
            {
                result = eat(list.subList(index, end), index, result);
            }
            else
            {
                result = null;
            }
        }
        if (list.size() != b.length)
        {
            result = null;
        }
        return result;
    }

    public static void solve(int[] a, int[] b)
    {
        StringBuffer stringBuffer = eat(a, b);
        if (stringBuffer == null)
        {
            out.println("NO");
        }
        else
        {
            out.println("YES");
            out.println(stringBuffer);
        }
    }

    public static void solve() throws IOException
    {
        int n = nextInt();
        int[] a = new int[n];
        for (int index = 0; index < n; index++)
        {
            a[index] = nextInt();
        }
        int k = nextInt();
        int[] b = new int[k];
        for (int index = 0; index < k; index++)
        {
            b[index] = nextInt();
        }
        solve(a, b);
    }
}