#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s, ans = "No";
  cin >> n;
  cin >> s;
  if (s.find("CC") < s.size() || s.find("MM") < s.size() ||
      s.find("YY") < s.size())
    ans = "No";
  else {
    if (s.find('?') == 0 || s.find('?') == s.size() - 1)
      ans = "Yes";
    else if (s.find('?') > 0) {
      for (int i = 1; i < s.size(); i++) {
        if (s[i] == '?' && s[i - 1] == s[i + 1]) {
          ans = "Yes";
          break;
        } else if (s[i] == '?' && s[i + 1] == s[i]) {
          ans = "Yes";
          break;
        } else if (s[i] == '?' && s[i - 1] == s[i]) {
          ans = "Yes";
          break;
        }
      }
    }
  }
  cout << ans << endl;
}
