#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n;
  vector<long long> A(n);
  for (int i = 0; i < n; i++) cin >> A[i];
  cin >> k;
  vector<long long> B(k);
  for (int i = 0; i < k; i++) cin >> B[i];
  bool good = true;
  int last = 0;
  vector<pair<int, char> > Ans;
  for (int h = 0; h < k && good; h++)
    if (A[last] != B[h]) {
      int j = last + 1, d = -1, lmax = last;
      bool the_same = true;
      long long sume = A[last];
      while (sume < B[h]) {
        sume += A[j];
        if (A[j] > A[lmax]) {
          lmax = j;
          d = j;
        }
        if (A[j] != A[j - 1]) the_same = false;
        j++;
      }
      j--;
      if (sume != B[h] || the_same)
        good = false;
      else {
        if (lmax == j) {
          for (int e = j - 1; e >= last; e--)
            Ans.push_back({h + e - last + 2, 'L'});
          last = j + 1;
        } else if (lmax != j && d == -1) {
          d = last;
          while (d + 1 < j && A[d + 1] == A[d]) d++;
          for (int e = d + 1; e <= j; e++)
            Ans.push_back({h + d - last + 1, 'R'});
          for (int e = d - 1; e >= last; e--)
            Ans.push_back({h + e - last + 2, 'L'});
          last = j + 1;
        } else if (lmax != j && d != -1) {
          for (int e = d - 1; e >= last; e--)
            Ans.push_back({h + e - last + 2, 'L'});
          for (int e = d + 1; e <= j; e++) Ans.push_back({h + 1, 'R'});
          last = j + 1;
        }
      }
    } else
      last++;
  if (!good || last != n)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    for (int f = 0; f < Ans.size(); f++)
      cout << Ans[f].first << " " << Ans[f].second << endl;
  }
  return 0;
}
