#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const long long N = 1e6 + 10;
char s[N];
long long a[N];
long long n, k;
int main() {
  long long i, len, j;
  long long tmp, flag, len_q = 0;
  scanf("%lld%lld", &n, &k);
  n++;
  for (i = 1; i <= n; i++) {
    scanf("%s", s);
    len = strlen(s);
    if (s[0] == '?') {
      a[i] = INF;
      len_q++;
      continue;
    }
    flag = 0;
    tmp = 0;
    for (j = 0; j < len; j++) {
      if (s[j] == '-')
        flag = 1;
      else {
        tmp *= 10;
        tmp += s[j] - '0';
      }
    }
    if (flag) tmp = -tmp;
    a[i] = tmp;
  }
  if (k == 0) {
    if (a[1] == INF) {
      if ((n - len_q) % 2) {
        printf("YES\n");
        return 0;
      } else {
        printf("NO\n");
        return 0;
      }
    } else {
      if (a[1] == 0) {
        printf("YES\n");
        return 0;
      } else {
        printf("NO\n");
        return 0;
      }
    }
  } else {
    tmp = 0;
    if (len_q == 0) {
      for (i = n; abs(tmp) < 1e14 && i >= 1; i--) {
        tmp *= k;
        tmp += a[i];
      }
      if (tmp == 0)
        printf("YES\n");
      else
        printf("NO\n");
    } else {
      if (n % 2 == 0) {
        printf("YES\n");
        return 0;
      } else {
        printf("NO\n");
        return 0;
      }
    }
  }
  return 0;
}
