#include<bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define REP(i,a,b) for(int i=(a);i>=(b);i--)
#define deb(x) cerr<<(#x)<<":"<<(x)<<'\n'
#define pb push_back
#define fi first
#define se second
#define hvie '\n'
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
int yh(){
	int ret=0;bool f=0;char c=getchar();
	while(!isdigit(c)){if(c==EOF)return -1;if(c=='-')f=1;c=getchar();}
	while(isdigit(c))ret=(ret<<3)+(ret<<1)+(c^48),c=getchar();
	return f?-ret:ret;
}
const int maxn=3e5+65,inf=0x3f3f3f3f;
int n;
int p[maxn];
struct segtree{
	int m[maxn<<2];bool ismax;
	#define ls (v<<1)
	#define rs (v<<1|1)
	#define mid ((l+r)>>1)
	void push_up(int v){
		m[v]=ismax?max(m[ls],m[rs]):min(m[ls],m[rs]);
	}
	void build(int v,int l,int r){
		m[v]=ismax?-inf:inf;
		if(l==r) return;
		build(ls,l,mid);build(rs,mid+1,r);
	}
	void modify(int v,int l,int r,int p,int val){
		if(l==r) return m[v]=ismax?max(m[v],val):min(m[v],val),void();
		if(p<=mid) modify(ls,l,mid,p,val);
		else modify(rs,mid+1,r,p,val);
		push_up(v);
	}
	int ask(int v,int l,int r,int al,int ar){
		if(al>ar) return ismax?-inf:inf;
		if(al<=l&&ar>=r)return m[v];
		if(ar<=mid) return ask(ls,l,mid,al,ar);
		else if(al>mid) return ask(rs,mid+1,r,al,ar);
		else return ismax? max(ask(ls,l,mid,al,ar),ask(rs,mid+1,r,al,ar)):
						   min(ask(ls,l,mid,al,ar),ask(rs,mid+1,r,al,ar));
	}
}mx,mn;
int dp[maxn],fa[maxn];
int main(){
	REP(_,yh(),1){
		n=yh();
		mx.ismax=1;mn.ismax=0;
		mx.build(1,0,n+1);mn.build(1,0,n+1);
		for(int i=0;i<n;i++) p[i]=yh();
		vector<int>dp(n+1,-inf);
		vector<int>fa(n+1,-2);
		dp[0]=0;fa[0]=-1;
		vector<int>L(n),R(n);
		FOR(i,0,n-1){
			L[i]=max(1,i-p[i]+1);
			R[i]=min(n,i+p[i]+1);
			mx.modify(1,0,n+1,i,R[i]);
		}
		mn.modify(1,0,n+1,0,0);
		FOR(i,1,n){
			int j=i-1;
			int k=L[j]-1;
			int m=mn.ask(1,0,n+1,k,n+1);
			// cout<<j<<" "<<k<<" "<<m<<hvie;
			if(m!=inf){
				int nval=max(mx.ask(1,0,n+1,m,i-2),i-1);
				// deb(nval);
				if(nval>dp[i]){
					dp[i]=nval;
					fa[i]=m;
				}
			}
			if(dp[j]>=i&&max(dp[j],R[j])>dp[i]){
				dp[i]=max(dp[j],R[j]);
				fa[i]=-1;
			}
			if(dp[j]>dp[i]){
				dp[i]=dp[j];
				fa[i]=-1;
			}
			mn.modify(1,0,n+1,dp[i],i);
			// cerr<<"MOdi: "<<dp[i]<<" "<<i<<hvie;
		}
		// for(int i=1;i<=n;i++)cout<<dp[i]<<" ";puts("");
		// for(int i=1;i<=n;i++)cout<<fa[i]<<" ";puts("");

		if(dp[n]!=n) puts("NO");
		else{
			puts("YES");
			string ans;
			int now=n;
			while(now){
				if(fa[now]==-1){
					now--;
					ans+="R";
				}
				else{
					int pre=fa[now];
					ans+="L";
					for(int j=now-1;j>pre;j--){
						ans+="R";
					}
					now=pre;
				}
			}
			reverse(ans.begin(),ans.end());
			cout<<ans<<hvie;
		}

	}
	return 0;
}
