#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, f, i, L, R, K, sum = 0, length, flag = 0;
scanf("%d %d", &n, &f);
char x[26];
cout << "Enter a string: ";
cin >> x;
if(x[26] >= 'z' && x[26] <= 'a'){
for(i=1; i<=f; i++){
scanf("%d %d %d", &L, &R, &K);
for(i=L; i<=R; i++){
sum += i;
}
}
}
if(sum == K){
if(x[i] != x[length-i-1]){
flag = 1;
break;
}
}
if (flag) {
cout << x << " no.." << endl;
}
else {
cout << x << " yes.." << endl;
}
system("pause");
return 0;
}