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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool isOn(T mask, T pos) {
  return mask & (1 << pos);
}
template <typename T>
inline int Off(T mask, T pos) {
  return mask ^ (1 << pos);
}
template <typename T>
inline int On(T mask, T pos) {
  return mask | (1 << pos);
}
template <class T>
inline int countbit(T n) {
  return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}
template <class T>
string toBinary(T n) {
  string ret = "";
  while (n) {
    if (n % 2 == 1)
      ret += '1';
    else
      ret += '0';
    n >>= 1;
  }
  reverse(ret.begin(), ret.end());
  return ret;
}
template <class T>
string toString(T n) {
  ostringstream ost;
  ost << n;
  ost.flush();
  return ost.str();
}
int toInt(string s) {
  int r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
long long int toLInt(string s) {
  long long int r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
double toDouble(string s) {
  double r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
vector<string> token(string str, string deli) {
  char *cstr, *p, *deli_c;
  deli_c = new char[deli.size() + 1];
  cstr = new char[str.size() + 1];
  strcpy(deli_c, deli.c_str());
  strcpy(cstr, str.c_str());
  vector<string> vec;
  p = strtok(cstr, deli_c);
  while (p != NULL) {
    vec.push_back(string(p));
    p = strtok(NULL, deli_c);
  }
  delete[] cstr;
  return vec;
}
template <class T>
inline T GCD(T a, T b) {
  if (a < 0) return GCD(-a, b);
  if (b < 0) return GCD(a, -b);
  return (b == 0) ? a : GCD(b, a % b);
}
template <class T>
inline T LCM(T a, T b) {
  if (a < 0) return LCM(-a, b);
  if (b < 0) return LCM(a, -b);
  return a * (b / GCD(a, b));
}
template <class T>
inline T BIGMOD(T n, T m, T mod) {
  long long int ans = 1;
  long long int k = n;
  while (m) {
    if (m & 1) {
      ans *= k;
      if (ans > mod) ans %= mod;
    }
    k *= k;
    if (k > mod) k %= mod;
    m >>= 1;
  }
  return ans;
}
template <class T>
T modInverse(T b, T m) {
  return BIGMOD(b, m - 2, m);
}
long long int fastExpo(long long int b, long long int p) {
  long long int res = 1, x = b;
  while (p) {
    if (p & 1) res *= x;
    x *= x;
    p = p >> 1;
  }
  return res;
}
long long int hash_table(char c[]) {
  long long int len = strlen(c);
  long long int hash_value = 0, base = 26, mod = 10000007;
  for (long long int i = 0; i < len; i++) {
    long long int n = c[i] - 64;
    long long int power = BIGMOD(base, i, mod);
    n = ((n % mod) * (power % mod)) % mod;
    hash_value = ((hash_value % mod) + (n % mod)) % mod;
  }
  return hash_value;
}
double dist(int x, int y, int x1, int y1) {
  return sqrt(((x1 - x) * (x1 - x)) + ((y1 - y) * (y1 - y)));
}
void makelengthequal(int p, char *a, char *b) {
  int l1, l2;
  l1 = strlen(a);
  l2 = strlen(b);
  int dif = (p - l1);
  {
    for (int j = l1 - 1; j >= 0; j--) {
      a[j + dif] = a[j];
    }
    for (int i = 0; i < dif; i++) a[i] = '0';
  }
  a[p] = '\0';
  dif = (p - l2);
  {
    for (int j = l2 - 1; j >= 0; j--) {
      b[j + dif] = b[j];
    }
    for (int i = 0; i < dif; i++) b[i] = '0';
  }
  b[p] = '\0';
  cout << a << endl << b << endl;
}
long long int ar[5002];
long long int b[5002];
long long int x[5002];
struct st {
  int p, v;
};
vector<st> v;
queue<int> qu, op;
int idd = 0;
st t;
int fun(int st, int ed, int ch) {
  int cnt = 0;
  int tt = idd;
  if (st == ed) return 1;
  for (int i = st; i < ed; i++) {
    if (ar[i] != ar[i + 1] && (ar[i] == ch || ar[i + 1] == ch)) {
      if (ar[i] == ch) {
        int cr = i + 1;
        int j;
        j = i;
        while (j < ed) {
          t.p = i + 1 - st + tt;
          j++;
          t.v = 1;
          v.push_back(t);
        }
        while (i > st) {
          t.p = i + 1 - st + tt;
          t.v = 0;
          v.push_back(t);
          i--;
        }
        return 1;
      } else {
        int j = i + 1;
        while (i >= st) {
          t.p = i + 2 - st + tt;
          t.v = 0;
          v.push_back(t);
          i--;
        }
        while (j < ed) {
          t.p = i + 2 - st + tt;
          j++;
          t.v = 1;
          v.push_back(t);
        }
        return 1;
      }
    }
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> ar[i];
  int k;
  cin >> k;
  for (int i = 0; i < k; i++) cin >> b[i];
  int sum = 0;
  int f = 1;
  int cur = 0;
  long long int mx = -1;
  int cnt = 0;
  idd = 0;
  for (int i = 0; i < n; i++) {
    if (sum + ar[i] < b[idd]) {
      mx = max(mx, ar[i]);
      sum += ar[i];
    } else if (sum + ar[i] == b[idd]) {
      sum = 0;
      mx = max(mx, ar[i]);
      if (fun(cur, i, mx) == 0) {
        f = 0;
        break;
      }
      mx = -1;
      cur = i + 1;
      idd++;
    } else {
      f = 0;
      break;
    }
  }
  if (idd < k) f = 0;
  if (f) {
    cout << "YES" << endl;
    {
      for (int j = 0; j < v.size(); j++) {
        cout << v[j].p << " ";
        if (v[j].v == 0)
          cout << "L" << endl;
        else
          cout << "R" << endl;
      }
    }
  } else
    cout << "NO" << endl;
}