#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, p, q, a;
  cin >> p >> q >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    if (q == 0 || a > p / q) return cout << "NO", 0;
    p -= q * a;
    swap(p, q);
  }
  cout << ((q) ? "NO" : "YES");
}
