#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> ans1;
  vector<char> ans2;
  int n1, n2;
  cin >> n1;
  vector<int> a1(n1);
  for (int i = 0; i < n1; i++) {
    cin >> a1[i];
  }
  cin >> n2;
  vector<int> a2(n2);
  for (int i = 0; i < n2; i++) {
    cin >> a2[i];
  }
  int now1 = 0, now2 = 0;
  for (int i = 0; i < n2; i++) {
    int s = 0;
    while (now2 < n1 && s < a2[i]) {
      s += a1[now2];
      now2++;
    }
    if (now2 > n1 || s != a2[i] || now1 == now2) {
      cout << "NO";
      return 0;
    }
    int temp = now1;
    for (int j = now1; j < now2; j++) {
      if (a1[temp] <= a1[j] && (j - 1 >= now1 && a1[j - 1] < a1[j] ||
                                j + 1 < now2 && a1[j + 1] < a1[j])) {
        temp = j;
      }
    }
    if (temp == now1 && temp + 1 < now2 && a1[temp + 1] == a1[temp]) {
      cout << "NO";
      return 0;
    }
    if (temp - 1 >= now1 && a1[temp] > a1[temp - 1]) {
      int him = a1[temp];
      int j = temp - 1;
      while (j >= now1 && him > a1[j]) {
        him += a1[j];
        ans1.push_back(i + j - now1 + 2);
        ans2.push_back('L');
        j--;
      }
      j = temp + 1;
      while (j < now2 && him > a1[j]) {
        him += a1[j];
        ans1.push_back(i + 1);
        ans2.push_back('R');
        j++;
      }
    } else {
      if (temp + 1 < now2 && a1[temp] > a1[temp + 1]) {
        int him = a1[temp];
        int j = temp + 1;
        while (j < now2 && him > a1[j]) {
          him += a1[j];
          ans1.push_back(i + temp - now1 + 1);
          ans2.push_back('R');
          j++;
        }
        j = temp - 1;
        while (j >= now1 && him > a1[j]) {
          him += a1[j];
          ans1.push_back(i + j - now1 + 2);
          ans2.push_back('L');
          j--;
        }
      }
    }
    now1 = now2;
    now2 = now1;
  }
  if (now2 != a1.size()) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 0; i < ans1.size(); i++) {
    cout << ans1[i] << " " << ans2[i] << endl;
  }
  return 0;
}
