#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;




int main(){
    ll n,k;
    cin >> n >> k;
    string s;
    cin >> s;
    for(ll i=0;i<k;i++){
        string t=s+s;
        for(ll j=0;j<n;j++){
            if(t[j*2]=='R'&&t[j*2+1]=='R')  s[j]='R';
            else if(t[j*2]=='R'&&t[j*2+1]=='S')  s[j]='R';
            else if(t[j*2]=='S'&&t[j*2+1]=='R')  s[j]='R';
            else if(t[j*2]=='S'&&t[j*2+1]=='R')  s[j]='R';
            else if(t[j*2]=='P'&&t[j*2+1]=='P')  s[j]='P';
            else if(t[j*2]=='R'&&t[j*2+1]=='P')  s[j]='P';
            else if(t[j*2]=='P'&&t[j*2+1]=='R')  s[j]='P';
            else if(t[j*2]=='S'&&t[j*2+1]=='S')  s[j]='S';
            else if(t[j*2]=='P'&&t[j*2+1]=='S')  s[j]='S';
            else if(t[j*2]=='S'&&t[j*2+1]=='P')  s[j]='S';
        }
    }
    cout << s[0] << endl;
    return 0;
}  


#include <bits/stdc++.h>
using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define LLMAX 9223372036854775807
#define ALL(x) x.begin(),x.end() 
using ll = int64_t;
using vl = vector<ll>;

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

//int の最大値 2147483647≒10^9
//long longの最大値 9,223,372,036,854,775,807≒10^18

int main() {
	ll a,b,c;
	cin >> a >> b >> c;
    string ans;
    if(a*a + b*b < c*c){
        ans = "Yes";
    }else{
        ans = "No";
    }
    cout << ans << endl;
}