#include <bits/stdc++.h>
using namespace std;
long long a[100];
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  long long p, q, tm;
  int n, i, j, k;
  while (scanf("%I64d%I64d", &p, &q) != EOF) {
    scanf("%d", &n);
    bool flag = 0;
    for (i = 0; i < n; i++) {
      scanf("%I64d", &a[i]);
      if (flag == 1) {
        continue;
      }
      if (p / q < a[i]) {
        flag = 1;
        continue;
      }
      tm = q;
      q = p - q * a[i];
      if (q <= 0 && i != n - 1) {
        flag = 1;
        continue;
      }
      p = tm;
      tm = gcd(p, q);
      p /= tm;
      q /= tm;
    }
    if (q > 0) flag = 1;
    if (flag == 1) {
      printf("NO\n");
    } else {
      printf("YES\n");
    }
  }
  return 0;
}
