// D - Happy Birthday! 2
#include <bits/stdc++.h>
using namespace std;
#define vec vector
using vi = vec<int>;
#define rp(i,s,e) for(int i=(s);i<(e);++i)
#define sz(a) int(a.size())

int N;
vi A(200);
vec<vi> B(200);
vec<bool> used(200);

void print(int n, vi v){
	cout<< n <<" "; rp(i, 0, n) cout<< v[i] << (i<n-1? " ":"\n");
}

bool dfs(int n, int r, vi C){
	if(sz(C) == n){
		if(!B[r].size()){ B[r] = C; return false; }
		puts("Yes"); print(sz(B[r]), B[r]); print(sz(C), C);
		return true;
	}
	rp(i, C.back(), N){
		if(used[i]) continue;
		used[i] = true;
		C.push_back(i+1);
		if(dfs(n, (r + A[i])%200, C)) return true;
		C.pop_back();
		used[i] = false;
	}
	return false;
}

int main(){
	cin>>N;
	for(int&x:A) cin>>x;
	rp(n, 1, N+1) rp(i, 0, N) if(dfs(n, A[i]%200, {i+1})) return 0;
	puts("No");
}

#include <bits/stdc++.h>
using namespace std;
const int N=2e2+5;
char w[N][N],s[N],t[N];
void prework(){
    w['R']['R']=w['R']['S']=w['S']['R']='R';
    w['S']['S']=w['S']['P']=w['P']['S']='S';
    w['P']['P']=w['P']['R']=w['R']['P']='P';
}
int main(){
    prework();
    int n,k;scanf("%d%d%s",&n,&k,s);
    while(k--){
        strcpy(t,s);strcat(t,s);
        for(int i=0;i<n;++i) s[i]=w[t[i*2]][t[i*2+1]];
    }
    printf("%c\n",s[0]);
    return 0;
}
