#include <bits/stdc++.h>
using namespace std;
bool consQM(string s, int n) {
  for (int i = 0; i < n; i++) {
    if (s[i] == s[i + 1] && s[i] == '?') {
      return true;
    }
  }
  return false;
}
bool lool(string s, int n) {
  if (s[0] == '?' || s[n - 1] == '?') {
    return true;
  }
  for (int i = 1; i < n - 1; i++) {
    if (s[i] == '?' && s[i - 1] == s[i + 1]) {
      return true;
    }
  }
  return false;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == s[i + 1] && s[i] != '?') {
      cout << "No" << endl;
      return 0;
    }
  }
  if (consQM(s, n) == true) {
    cout << "Yes" << endl;
    return 0;
  }
  if (consQM(s, n) == false && count(s.begin(), s.end(), '?') >= 1) {
    if (lool(s, n)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  int x = s.find('?');
  if (count(s.begin(), s.end(), '?') == 1 && s[x - 1] == s[x + 1]) {
    cout << "Yes" << endl;
    return 0;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
