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