#include<iostream>
#include<vector>
using namespace std;
int win(int a,int b){
	if((b-a+3)%3==2)return b;
	else return a;
}
int main(){
	int n,k,size;
	string s,u;
	vector<int> v[102];
	cin>>n>>k>>s;
	for(int i=0;i<n;i++){
		if(s[i]=='R')v[0].push_back(0);
		else if(s[i]=='S')v[0].push_back(1);
		else if(s[i]=='P')v[0].push_back(2);
	}
	for(int i=0;i<k;i++){
		size=v[i].size();
		if(size%2){
			for(int j=0;j<size;j++)v[i].push_back(v[i][j]);
		}else size/=2;
		for(int j=0;j<size;j++){
			v[i+1].push_back(win(v[i][2*j],v[i][2*j+1]));
		}
	}
	if(v[k][0]==0)cout<<'R';
	else if(v[k][0]==1)cout<<'S';
	else if(v[k][0]==2)cout<<'P';
	return 0;
}
#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    vector<int> a(4);
    cin >> a[0] >> a[1] >> a[2] >> a[3];
    sort(a.begin(), a.end());
    int sum = a[0] + a[1] + a[2] + a[3];
    if (sum % 2) {
        cout << "No" << endl;
        return 0;
    }
    sum = sum / 2;
    if (a[3] == sum || a[3] + a[0] == sum) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}