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