#include <bits/stdc++.h>
using namespace std;
const int mxn = 111;
string str;
long long dp[mxn][55];
char ch[] = {'C', 'Y', 'M'};
long long solve(int pos, int p) {
  if (pos >= str.size()) return 1;
  char pre = p + 'A';
  int post = pos + 1;
  if (dp[pos][p] != -1) return dp[pos][p];
  if (str[pos] != '?') return dp[pos][p] = solve(pos + 1, str[pos] - 'A');
  long long ret = 0;
  for (int i = 0; i < 3; i++) {
    if (ch[i] == pre) continue;
    if (post < str.size() && ch[i] == str[post]) continue;
    ret += solve(pos + 1, ch[i] - 'A');
    if (ret >= 2) break;
  }
  return dp[pos][p] = ret;
}
int main() {
  int n;
  cin >> n;
  cin >> str;
  memset(dp, -1, sizeof dp);
  bool flag = true;
  for (int i = 1; i < n; i++) {
    if (str[i - 1] == str[i] && str[i] != '?') {
      flag = false;
      break;
    }
  }
  long long ret = 0;
  if (flag) {
    ret = solve(0, 0);
  }
  if (ret >= 2) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
