#include <bits/stdc++.h>
using namespace std;
long long p, q;
int n;
long long a[103];
long long b[103][15003];
long long c[15003];
long long f[15003];
long long g[15003];
int len[103];
int lenp;
int lenq;
long long pp[15003];
long long qq[15003];
int main() {
  scanf("%I64d %I64d", &p, &q);
  scanf("%d", &n);
  int i;
  int j, jj;
  for (i = 0; i < n; i++) scanf("%I64d", &a[i]);
  if (n == 1) {
    if (p % q != 0 || p / q != a[0])
      printf("NO\n");
    else
      printf("YES\n");
    return 0;
  }
  for (i = 0; i < n; i++) {
    while (a[i] > 0) {
      b[i][len[i]++] = a[i] % 10;
      a[i] /= 10;
    }
  }
  b[n][0] = 1;
  len[n] = 1;
  int ind;
  for (i = n - 2; i > -1; i--) {
    for (j = 0; j < len[i]; j++)
      for (jj = 0; jj < len[i + 1]; jj++) c[j + jj] += b[i][j] * b[i + 1][jj];
    ind = 0;
    for (j = 0; j < len[i] + len[i + 1] + 1; j++) {
      if (c[j] > 0) ind = j;
      c[j + 1] += c[j] / 10;
      c[j] %= 10;
    }
    len[i] = ind + 1;
    len[i] = max(len[i], len[i + 2]);
    for (j = 0; j < len[i]; j++) {
      c[j] += b[i + 2][j];
      if (c[j] > 9) {
        c[j] -= 10;
        c[j + 1]++;
      }
    }
    if (c[len[i]] > 0) len[i]++;
    for (j = 0; j < len[i]; j++) b[i][j] = c[j];
    for (j = 0; j < len[i]; j++) c[j] = 0;
  }
  while (p > 0) {
    pp[lenp++] = p % 10;
    p /= 10;
  }
  while (q > 0) {
    qq[lenq++] = q % 10;
    q /= 10;
  }
  for (j = 0; j < lenp; j++)
    for (jj = 0; jj < len[1]; jj++) f[j + jj] += pp[j] * b[1][jj];
  for (j = 0; j < lenq; j++)
    for (jj = 0; jj < len[0]; jj++) g[j + jj] += qq[j] * b[0][jj];
  for (i = 0; i < 15000; i++) {
    f[i + 1] += f[i] / 10;
    f[i] %= 10;
    g[i + 1] += g[i] / 10;
    g[i] %= 10;
  }
  bool flag = true;
  for (i = 0; i < 15000; i++)
    if (f[i] != g[i]) flag = false;
  if (!flag) {
    printf("NO\n");
    return 0;
  }
  printf("YES\n");
  return 0;
}
