#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
long long a[N], b[N];
pair<int, int> ans[N];
int n, m, INDEX = 0, cnt = 0;
bool ok(int x, int y) {
  if (x == y) return 1;
  long long mx = a[x];
  int id = x;
  int flag;
  bool Found = false;
  for (int i = x + 1; i <= y; i++) {
    if (a[x] != a[i]) Found = true;
    if (mx < a[i]) {
      id = i;
      flag = -1;
      mx = a[i];
    } else if (mx == a[i]) {
      if (a[i - 1] < a[i]) {
        id = i;
        flag = -1;
      }
      if (i != y && a[i + 1] < a[i]) {
        id = i;
        flag = 1;
      }
    }
  }
  if (!Found) return 0;
  if (flag > 0) {
    for (int i = id; i <= y - 1; i++)
      ans[++cnt].first = id + INDEX, ans[cnt].second = 1;
    for (int i = id; i > x; i--)
      ans[++cnt].first = id + INDEX, ans[cnt].second = 0, id--;
  } else {
    int tmp = id;
    for (int i = id; i > x; i--)
      ans[++cnt].first = id + INDEX, ans[cnt].second = 0, id--;
    for (int i = tmp; i <= y - 1; i++)
      ans[++cnt].first = x + INDEX, ans[cnt].second = 1;
  }
  return 1;
}
int main() {
  long long suma = 0, sumb = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i], suma += a[i];
  cin >> m;
  for (int i = 1; i <= m; i++) cin >> b[i], sumb += b[i];
  if (suma != sumb) {
    puts("NO");
    return 0;
  }
  long long sum = 0, j = 1, prev = 1;
  for (int i = 1; i <= n; i++) {
    sum += a[i];
    if (sum > b[j]) {
      puts("NO");
      return 0;
    } else if (sum == b[j]) {
      if (!ok(prev, i)) {
        puts("NO");
        return 0;
      }
      prev = i + 1;
      j++;
      INDEX = j - prev;
      sum = 0;
    }
  }
  if (cnt != n - m) {
    puts("NO");
    return 0;
  }
  puts("YES");
  for (int i = 1; i <= cnt; i++) {
    cout << ans[i].first << " ";
    if (ans[i].second)
      cout << "R";
    else
      cout << "L";
    cout << endl;
  }
  return 0;
}
