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