#include <bits/stdc++.h>
using namespace std;
long long p, q, n, x[100], t;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool can(long long p, long long q, int k) {
  if (k == n - 1) {
    if (p == x[n - 1] && q == 1) return 1;
    return 0;
  }
  t = p / q;
  if (p % q == 0) t--;
  if (t < x[k]) return 0;
  p -= q * x[k];
  t = gcd(p, q);
  p /= t;
  q /= t;
  return can(q, p, k + 1);
}
int main() {
  cin >> p >> q;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i];
  t = gcd(p, q);
  p /= t;
  q /= t;
  if (can(p, q, 0)) {
    cout << "YES" << endl;
  } else
    cout << "NO" << endl;
}
