#include <bits/stdc++.h>
using namespace std;
const int MAX_INT = (1 << 31) - 1;
const long long MAX_LL = (1LL << 63) - 1;
const long long BIG_LL = 1e18;
int main() {
  long long p, q;
  int n;
  long long a[90];
  cin >> p >> q >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n - 1; ++i) {
    if (a[i] > BIG_LL / q) {
      cout << "NO" << endl;
      return 0;
    }
    p -= a[i] * q;
    if (p <= 0) {
      cout << "NO" << endl;
      return 0;
    }
    swap(p, q);
  }
  if (a[n - 1] <= BIG_LL / q && p == a[n - 1] * q)
    cout << "YES";
  else
    cout << "NO";
  cout << endl;
  return 0;
}
