#include <bits/stdc++.h>
using namespace std;
long long p, q, n, tg, a[100 + 10];
int main() {
  cin >> p >> q;
  cin >> n;
  for (int i = (1), _b = (n); i <= _b; i++) {
    cin >> a[i];
    if (q == 0 || p / q < a[i]) {
      cout << "NO";
      return 0;
    } else {
      tg = p - q * a[i];
      p = q;
      q = tg;
    }
  }
  if (q == 0)
    cout << "YES";
  else
    cout << "NO";
}
