#include <bits/stdc++.h>
using namespace std;
long double p, q, k, n;
bool Check() {
  for (int i = 1; i <= n; ++i) {
    cin >> k;
    p -= q * k;
    if (p < 0) {
      return false;
    }
    swap(p, q);
  }
  return abs(q) <= 0.000001;
}
int main() {
  cin >> p >> q;
  cin >> n;
  puts(Check() ? "YES" : "NO");
  return 0;
}
