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