#include <bits/stdc++.h>   using namespace std;   long long int n, m, ar[1000005], sum, t, ar2[1000005];   vector<int> ans;   vector<pair<int, char> > res;   int main() {     cin.tie(0);     cout.tie(0);     ios_base::sync_with_stdio(false);     cin >> n;     for (long long int i = 1; i <= n; i++) cin >> ar[i];     cin >> m;     for (long long int i = 1; i <= m; i++) cin >> ar2[i];     long long int top = 0;     long long int l = 1;     for (long long int i = 1; i <= n + 1; i++) {       if (l > m) return cout <<  NO , 0;       if (top < ar2[l]) {         top += ar[i];         continue;       }       if (top > ar2[l]) return cout <<  NO , 0;       ans.push_back(i - 1);       l++;       top = ar[i];     }     if (top || l <= m) return cout <<  NO , 0;     cout <<   n ;     int last = 1;     long long int cnt = 0;     for (int h = 0; h < ans.size(); h++) {       long long int y = ans[h];       long long int mk = 0, mn = INT_MAX;       for (int i = last; i <= y; i++) {         mk = max(mk, ar[i]);         mn = min(mn, ar[i]);       }       if (last == y) {         last++;         cnt = y - h - 1;         continue;       }       if (mn == mk) {         return cout <<  NO , 0;       }       long long int mki = 0;       char mki2;       long long int z = y - last + 1;       for (long long int i = last; i <= y; i++) {         if (ar[i] != mk) continue;         if (i != last && ar[i - 1] != ar[i]) {           mki = i;           mki2 =  L ;           res.push_back({mki - cnt, mki2});           mki--;           break;         }         if (i != y && ar[i] != ar[i + 1]) {           mki = i;           mki2 =  R ;           res.push_back({mki - cnt, mki2});           break;         }       }       z--;       z--;       while (mki > last) {         res.push_back({mki - cnt,  L });         mki--;         z--;       }       while (z--) {         res.push_back({mki - cnt,  R });       }       cnt = y - h - 1;       last = y + 1;     }     cout <<  YES           <<   n ;     for (int i = 0; i < res.size(); i++)       cout << res[i].first <<     << res[i].second <<   n ;   }   