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