#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int dp[N][3], to[255];
int main() {
  ios::sync_with_stdio(0);
  int n;
  string s;
  cin >> n;
  cin >> s;
  to['C'] = 0, to['M'] = 1, to['Y'] = 2;
  if (s[0] == '?') {
    dp[0][0] = dp[0][1] = dp[0][2] = 1;
  } else {
    dp[0][to[s[0]]] = 1;
  }
  for (int i = 1; i < ((int)(s).size()); i++) {
    if (s[i] == '?') {
      dp[i][0] = dp[i - 1][1] + dp[i - 1][2];
      dp[i][1] = dp[i - 1][0] + dp[i - 1][2];
      dp[i][2] = dp[i - 1][0] + dp[i - 1][1];
    } else {
      int ch = to[s[i]];
      dp[i][ch] = dp[i - 1][0] + dp[i - 1][1] + dp[i - 1][2] - dp[i - 1][ch];
    }
    for (int j = 0; j < 3; j++) {
      if (dp[i][j] > N) {
        dp[i][j] = N;
      }
    }
  }
  puts(dp[((int)(s).size()) - 1][0] + dp[((int)(s).size()) - 1][1] +
                   dp[((int)(s).size()) - 1][2] >
               1
           ? "Yes"
           : "No");
  return 0;
}
