#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> s;
  s = '?' + s + '?';
  int c = 0;
  bool flag = true;
  for (int i = 1; i <= n; i++) {
    if (s[i] == '?') {
      c++;
      if (s[i - 1] == s[i + 1] || s[i - 1] == '?' || s[i + 1] == '?') {
        flag = false;
      }
    }
    if (s[i] == s[i - 1] && s[i] != '?') {
      flag = true;
      break;
    }
  }
  cout << (c == 0 || flag ? "NO" : "YES") << '\n';
  return 0;
}
