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