#include <bits/stdc++.h>
using namespace std;
const int MOD(1e9 + 7);
int n, m, a[555], b[555], d[555][555];
int Compress(int l, int r) {
  if (l > n) return r > m ? 555 : 0;
  if (r > m) return l > n ? 555 : 0;
  int& ret = d[l][r];
  if (~ret) return ret;
  ret = 0;
  int s = 0, k;
  for (k = l; k <= n; k++) {
    s += a[k];
    if (s >= b[r]) break;
  }
  if (s == b[r]) {
    if (Compress(k + 1, r + 1)) return ret = k + 1;
  }
  return ret;
}
vector<pair<int, char>> output;
bool Reconstruct(int l, int r) {
  if (l > n) return r > m;
  if (r > m) return l > m;
  int arg = l;
  for (int k = l; k < d[l][r]; k++)
    if (a[arg] <= a[k] && ((k + 1 < d[l][r] && a[k + 1] < a[k]) ||
                           (k - 1 >= l && a[k - 1] < a[k])))
      arg = k;
  int le = arg, ri = arg, cw = a[arg], base = r;
  vector<pair<int, char>> output2;
  while (le > l || ri + 1 < d[l][r]) {
    bool work = false;
    if (le > l && cw > a[le - 1])
      work = true, cw += a[le - 1], output2.push_back({(le - l) + base, 'L'}),
      --le;
    if (ri + 1 < d[l][r] && cw > a[ri + 1])
      work = true, cw += a[ri + 1], output2.push_back({(le - l) + base, 'R'}),
      ++ri;
    if (!work) {
      output2.clear();
      break;
    }
  }
  if (le != l || ri + 1 != d[l][r]) {
    arg = d[l][r] - 1;
    for (int k = d[l][r] - 1; k >= l; k--)
      if (a[arg] <= a[k] && ((k + 1 < d[l][r] && a[k + 1] < a[k]) ||
                             (k - 1 >= l && a[k - 1] < a[k])))
        arg = k;
    le = arg;
    ri = arg;
    cw = a[arg];
    while (le > l || ri + 1 < d[l][r]) {
      bool work = false;
      if (le > l && cw > a[le - 1])
        work = true, cw += a[le - 1], output2.push_back({(le - l) + base, 'L'}),
        --le;
      if (ri + 1 < d[l][r] && cw > a[ri + 1])
        work = true, cw += a[ri + 1], output2.push_back({(le - l) + base, 'R'}),
        ++ri;
      if (!work) {
        return false;
      }
    }
  }
  output.insert(output.end(), (output2).begin(), (output2).end());
  return Reconstruct(d[l][r], r + 1);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) scanf("%d", b + i);
  memset(d, -1, sizeof d);
  if (Compress(1, 1) && Reconstruct(1, 1)) {
    puts("YES");
    for (auto& first : output) printf("%d %c\n", first.first, first.second);
  } else {
    puts("NO");
  }
  return 0;
}
