#include <bits/stdc++.h>
using namespace std;
int main() {
  long long p, q, n, k;
  bool r = false;
  cin >> p >> q;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  long long b[n];
  for (int i = 0; i < n; i++) {
    if ((q == 0) && (i == n - 1) && (p == 1)) {
      b[n - 2]--;
      b[n - 1] = 1;
      break;
    }
    if (q == 0) {
      r = true;
      break;
    }
    b[i] = p / q;
    k = q;
    q = p % q;
    p = k;
  }
  if (r || (q != 0)) {
    cout << "NO";
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (a[i] != b[i]) r = true;
  }
  if (r)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
