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