#include <bits/stdc++.h>
using namespace std;
const int N = 101000, mod = 1000000007;
int n, k, a[N] = {};
char ch[100] = {};
int main() {
  scanf("%d%d", &n, &k);
  if (k == 0) {
    scanf("\n%s", ch);
    if (ch[0] == '?') {
      int t = 0;
      for (int i = 1; i <= n; ++i) {
        scanf("\n%s", ch);
        t += (ch[0] != '?');
      }
      puts(t % 2 ? "Yes" : "No");
    } else {
      sscanf(ch, "%d", a);
      puts(a[0] ? "No" : "Yes");
    }
    return 0;
  }
  for (int i = 0; i <= n; ++i) {
    scanf("\n%s", ch);
    if (ch[0] == '?') {
      puts((n % 2 == 0) ? "No" : "Yes");
      return 0;
    } else
      sscanf(ch, "%d", a + i);
  }
  int now = 0;
  for (int i = 0; i <= n; ++i) {
    now += a[i];
    if (now % k) {
      puts("No");
      return 0;
    }
    now /= k;
  }
  puts(now ? "No" : "Yes");
}
