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