#include <bits/stdc++.h>
using namespace std;
int gd(long long a) {
  int i;
  while (a > 0) {
    a /= 10;
    i++;
  }
  return i;
}
int main() {
  double d;
  long long p, q, a[90];
  cin >> p >> q;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long x = p, y = q;
  for (int i = 0; i < n; i++) {
    if (y == 0) {
      cout << "NO";
      return false;
    }
    d = x / y;
    if ((d - a[i]) < 0) {
      cout << "NO";
      return 0;
    }
    x = x - a[i] * y;
    x = x + y;
    y = x - y;
    x = x - y;
  }
  if (y == 0)
    cout << "YES";
  else
    cout << "NO";
}
