#include <bits/stdc++.h>
int main() {
  long long q, p;
  long long tmp;
  long double test;
  long long a[95];
  int n;
  scanf("%I64d %I64d", &p, &q);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%I64d", &a[i]);
  for (int i = 0; i < n; i++) {
    test = (long double)q * (long double)a[i];
    if (test > 10e18)
      p = -1;
    else
      p -= q * a[i];
    tmp = p;
    p = q;
    q = tmp;
    if (q < 0) break;
  }
  if (q == 0)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
