#include <bits/stdc++.h>
using namespace std;
const int N = 577 + 7, mod = 1000000007, inf = 1000000007;
const long long lmod = 1000000007, linf = 1e18 + 77;
const long double eps = 1e-9;
int a[N];
int b[N];
vector<int> g[N];
int m = 0;
pair<bool, int> f[N][N];
int sum[N][N];
pair<int, int> pr[N][N];
char eat[N][N];
vector<pair<int, char> > ans[N];
vector<pair<int, char> > normAns;
vector<pair<int, char> > tmpAns;
int id = 0;
int main() {
  ios_base::sync_with_stdio(0);
  int n, k;
  int suma = 0;
  int sumb = 0;
  scanf("%d", &n);
  ;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    ;
    suma += a[i];
  }
  scanf("%d", &k);
  ;
  for (int i = 0; i < k; i++) {
    scanf("%d", &b[i]);
    ;
    sumb += b[i];
  }
  if (suma != sumb) {
    cout << "NO\n";
    return 0;
  }
  for (int i = 0; i < n; i++) {
    b[m] -= a[i];
    g[m].push_back(a[i]);
    if (b[m] == 0) {
      m++;
    } else {
      if (b[m] < 0) {
        cout << "NO\n";
        return 0;
      }
    }
  }
  for (int p = 0; p < m; p++) {
    vector<int> cur = g[p];
    if (cur.size() == 1) {
      id++;
      continue;
    }
    int n = cur.size();
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        f[i][j] = {0, -1};
        sum[i][j] = 0;
        pr[i][j] = {-1, -1};
        eat[i][j] = '0';
      }
    }
    for (int i = 0; i < n; i++) {
      f[i][i] = {1, i};
      sum[i][i] = cur[i];
    }
    for (int len = 1; len < n; len++) {
      for (int i = 0; i < n; i++) {
        int l1 = i;
        int r1 = i + len - 1;
        int add1 = i + len;
        int l2 = i + 1;
        int r2 = i + len;
        int add2 = i;
        if (r2 >= n || r1 >= n || add1 >= n) {
          continue;
        }
        if (f[l1][r1].first && sum[l1][r1] > sum[add1][add1]) {
          f[l1][r1 + 1] = f[l1][r1];
          sum[l1][r1 + 1] = sum[l1][r1] + sum[add1][add1];
          pr[l1][r1 + 1] = {l1, r1};
          eat[l1][r1 + 1] = 'R';
        }
        if (f[l2][r2].first && sum[l2][r2] > sum[add2][add2]) {
          f[l2 - 1][r2] = f[l2][r2];
          sum[l2 - 1][r2] = sum[l2][r2] + sum[add2][add2];
          pr[l2 - 1][r2] = {l2, r2};
          eat[l2 - 1][r2] = 'L';
        }
      }
    }
    if (f[0][n - 1].first == 0) {
      cout << "NO" << endl;
      return 0;
    }
    int i = 0;
    int j = n - 1;
    vector<pair<int, char> > curAns;
    while (i != j) {
      int ni = pr[i][j].first;
      int nj = pr[i][j].second;
      curAns.push_back(make_pair(f[i][j].second + id, eat[i][j]));
      i = ni;
      j = nj;
    }
    reverse(curAns.begin(), curAns.end());
    ans[p] = curAns;
    id += n;
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < ans[i].size(); j++) {
      tmpAns.push_back(ans[i][j]);
    }
  }
  for (int i = 0; i < tmpAns.size(); i++) {
    int id = tmpAns[i].first;
    normAns.push_back(tmpAns[i]);
    for (int j = i + 1; j < tmpAns.size(); j++) {
      if (tmpAns[i].second == 'R') {
        if (tmpAns[j].first > id) {
          tmpAns[j].first--;
        }
      } else {
        if (tmpAns[j].first >= id) {
          tmpAns[j].first--;
        }
      }
    }
  }
  cout << "YES"
       << "\n";
  for (int i = 0; i < normAns.size(); i++) {
    cout << normAns[i].first + 1 << " " << normAns[i].second << "\n";
  }
}
