#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int maxn = 100100;
const int mod = 1e9 + 7;
const int INF = 1e9;
int a[550], b[550];
pair<int, string> p[1000];
int sum1, sum2;
int main() {
  int n, m;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum1 += a[i];
  }
  cin >> m;
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
    sum2 += b[i];
  }
  if (sum1 != sum2) {
    cout << "NO" << endl;
    return 0;
  }
  int i = 1, j = 1, cnt = 1, pre = 0;
  while (j <= m) {
    int sum = a[i], st = i;
    i++;
    if (sum == b[j]) {
      j++;
      continue;
    }
    while (sum < b[j] && i <= n) sum += a[i++];
    if (sum > b[j] || sum < b[j]) break;
    int Max = 0;
    for (int k = st; k < i; k++) Max = max(Max, a[k]);
    int flag = 0, pos;
    for (int k = st; k < i; k++) {
      if (((k - 1 >= st && a[k] > a[k - 1]) ||
           (k + 1 < i && a[k] > a[k + 1])) &&
          Max == a[k]) {
        pos = k;
        flag = 1;
        break;
      }
    }
    if (!flag) break;
    j++;
    int num = 0;
    if (a[pos] > a[pos + 1]) {
      while (num < i - 1 - pos) {
        p[cnt].first = pos - pre;
        p[cnt++].second = "R";
        num++;
      }
      while (pos > st) {
        p[cnt].first = pos - pre;
        p[cnt++].second = "L";
        pos--;
      }
    } else {
      int k = i - 1 - pos;
      while (pos > st) {
        p[cnt].first = pos - pre;
        p[cnt++].second = "L";
        pos--;
      }
      int num = 0;
      while (num < k) {
        p[cnt].first = pos - pre;
        p[cnt++].second = "R";
        num++;
      }
    }
    pre = i - 1 - (j - 1);
    if (i > n) break;
  }
  if (j > m) {
    cout << "YES" << endl;
    for (int i = 1; i < cnt; i++)
      cout << p[i].first << " " << p[i].second << endl;
  } else
    cout << "NO" << endl;
}
