#include <bits/stdc++.h>
using namespace std;
uint64_t gcd(uint64_t a, uint64_t b) {
  uint64_t c;
  while (a != 0) {
    c = a;
    a = b % a;
    b = c;
  }
  return b;
}
int main(void) {
  uint64_t p, q, n;
  cin >> p >> q >> n;
  uint64_t aux = gcd(p, q);
  p /= aux;
  q /= aux;
  while (n--) {
    uint64_t x;
    cin >> x;
    if (q == 0 || x > p / q) {
      cout << "NO\n";
      return 0;
    } else
      p -= x * q;
    swap(p, q);
  }
  if (q == 0)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
