#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); string s; cin >> s; if (s == "MMA") cout << "Yes" << endl; else cout << "No" << endl; return 0; }