#include <bits/stdc++.h>
int main() {
  long long int i, p, q, n, j, a[100], l = 1;
  scanf("%lld%lld%lld", &p, &q, &n);
  for (j = 0; j < n; j++) {
    scanf("%lld", &a[j]);
  }
  for (j = 0; j < n; j++) {
    if (l == 0 || (p / q) < a[j]) {
      break;
    }
    l = p - q * a[j];
    p = q;
    q = l;
  }
  if (l == 0 && j == n) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  return 0;
}
