#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6;
const long long mod = 1e9 + 7;
const long long mod2 = 1e9 + 9;
const long long mod3 = 123456987;
const long long mod4 = 212345347;
long long n, k;
int a[maxn];
int d[maxn];
char s[maxn];
int main() {
  cin >> n >> k;
  int cnt = 0;
  for (int i = 0; i <= n; i++) {
    scanf("%s", s);
    if (s[0] == '?')
      d[i] = 1, cnt++;
    else
      sscanf(s, "%d", &a[i]);
  }
  if (k == 0) {
    if (!d[0] && a[0] == 0 || (d[0] && (n + 1 - cnt) % 2 == 1))
      puts("YES");
    else
      puts("NO");
    return 0;
  }
  if (cnt == 0) {
    long long val = 0;
    long long val2 = 0, val3 = 0, val4 = 0;
    long long x = 1, x2 = 1, x3 = 1, x4 = 1;
    for (int i = 0; i <= n; i++) {
      val += (a[i] * x) % mod;
      val2 += (a[i] * x2) % mod2;
      val3 += (a[i] * x3) % mod3;
      val4 += (a[i] * x4) % mod4;
      val = (val + 3 * mod) % mod;
      val2 = (val2 + 3 * mod2) % mod2;
      val3 = (val3 + 3 * mod3) % mod3;
      val4 = (val4 + 3 * mod4) % mod4;
      x = (x * k) % mod;
      x2 = (x2 * k) % mod2;
      x3 = (x3 * k) % mod3;
      x4 = (x4 * k) % mod4;
    }
    if (val == 0 && val2 == 0 && val3 == 0 && val4 == 0)
      puts("YES");
    else
      puts("NO");
  } else {
    if ((n + 1) % 2 == 0)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
