#include <bits/stdc++.h>
using namespace std;
int main() {
  long long p, q, n, x, i;
  cin >> p >> q >> n;
  for (i = 0; i < n; i++) {
    cin >> x;
    if (q == 0) {
      cout << "NO";
      return 0;
    }
    if (x > p / q) {
      cout << "NO";
      return 0;
    } else {
      p -= q * x;
      x = p;
      p = q;
      q = x;
    }
  }
  if (q == 0)
    cout << "YES";
  else
    cout << "NO";
}
