#include <bits/stdc++.h>
using namespace std;
void _print(long long t) { cerr << t; }
void _print(int t) { cerr << t; }
void _print(string t) { cerr << t; }
void _print(char t) { cerr << t; }
void _print(long double t) { cerr << t; }
void _print(double t) { cerr << t; }
void _print(unsigned long long t) { cerr << t; }
template <class T, class V>
void _print(pair<T, V> p);
template <class T>
void _print(vector<T> v);
template <class T>
void _print(set<T> v);
template <class T, class V>
void _print(map<T, V> v);
template <class T>
void _print(multiset<T> v);
template <class T, class V>
void _print(pair<T, V> p) {
  cerr << "{";
  _print(p.first);
  cerr << ",";
  _print(p.second);
  cerr << "}";
}
template <class T>
void _print(vector<T> v) {
  cerr << "[ ";
  for (T i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T>
void _print(set<T> v) {
  cerr << "[ ";
  for (T i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T>
void _print(multiset<T> v) {
  cerr << "[ ";
  for (T i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T, class V>
void _print(map<T, V> v) {
  cerr << "[ ";
  for (auto i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T, class V>
void _print(multimap<T, V> v) {
  cerr << "[ ";
  for (auto i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T, class V>
void _print(unordered_map<T, V> v) {
  cerr << "[ ";
  for (auto i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
template <class T, class V>
void _print(unordered_set<T, V> v) {
  cerr << "[ ";
  for (auto i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
bool isvalid(int N, int M, int i, int j) {
  if (i >= 0 && j >= 0 && i < N && j < M) {
    return true;
  } else {
    return false;
  }
}
int power(int x, int y, int p) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return ((long long)power(x, y / 2, p) * power(x, y / 2, p)) % p;
  else
    return ((((long long)power(x, y / 2, p) * power(x, y / 2, p)) % p) * x) % p;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == s[i + 1] && s[i] != '?') {
      cout << "NO";
      return 0;
    }
  }
  if (s[0] == '?' || s[n - 1] == '?') {
    cout << "YES";
    return 0;
  }
  for (int i = 0; i < n - 2; i++) {
    if (s[i] == '?' && s[i + 1] == '?') {
      cout << "YES";
      return 0;
    }
    if (s[i] == s[i + 2] && s[i + 1] == '?') {
      cout << "YES";
      return 0;
    }
  }
  if (s[n - 2] == s[n - 1] && s[n - 2] == '?') {
    cout << "YES";
    return 0;
  }
  cout << "NO";
}
