#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
int n, k;
bool qm[N];
int a[N];
char x[7];
int main() {
  scanf("%d", &n), scanf("%d", &k);
  int cnt = 0;
  for (int i = 0; i < n + 1; ++i) {
    scanf(" %s", x);
    if (x[0] == '?')
      qm[i] = 1;
    else
      a[i] = stoi(x), cnt++;
  }
  if (k == 0) {
    if (a[0] || (qm[0] && cnt % 2 == 0))
      puts("NO");
    else
      puts("YES");
    return 0;
  }
  if (cnt != n + 1) {
    if ((n + 1) % 2 == 0)
      puts("YES");
    else
      puts("NO");
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (a[i] % k) return puts("NO");
    a[i + 1] += a[i] / k;
  }
  puts((a[n] ? "NO" : "YES"));
}
