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