#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  clock_t t1, t2;
  t1 = clock();
  long long int p, q;
  cin >> p >> q;
  int n;
  cin >> n;
  int i;
  for (i = 1; i <= n; i++) {
    long long int a;
    cin >> a;
    long long int ls, rs;
    ls = p / q;
    rs = a;
    if (rs > ls) {
      cout << "NO"
           << "\n";
      return 0;
    }
    p = p - a * q;
    if (i <= n - 1) {
      swap(p, q);
    }
    if (q == 0) {
      cout << "NO"
           << "\n";
      return 0;
    }
  }
  if (p == 0) {
    cout << "YES"
         << "\n";
  } else {
    cout << "NO"
         << "\n";
  }
  t2 = clock();
  float diff = (float)t2 - (float)t1;
  float execution_time = diff / CLOCKS_PER_SEC;
  return 0;
}
