#include <bits/stdc++.h>
using namespace std;
priority_queue<int> Q;
int main() {
  long long n, p, q, a, b, c;
  cin >> p >> q >> n;
  long long val;
  bool flag = true;
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &val);
    if (p < 0 || q <= 0) {
      flag = false;
      continue;
    }
    a = p / q - val;
    b = q;
    c = p % q;
    if (double(a * q) == (double)a * q)
      c += a * q;
    else
      flag = false;
    p = b;
    q = c;
  }
  if (q == 0 && flag) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
