#include <bits/stdc++.h>
using namespace std;
char s[110];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  for (int i = 0; i < n; i++) {
    if (s[i] != '?' && s[i] == s[i + 1]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '?') {
      if (s[i - 1] == s[i + 1] || i == 0 || i == n - 1 || s[i] == s[i + 1]) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
