#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  long long p, q, n;
  cin >> p >> q >> n;
  vector<long long> arr(n);
  for (int i = 0; i < n; ++i) cin >> arr[i];
  for (int i = 0; i < n - 1; ++i) {
    long long a = arr[i];
    if (q == 0 || p / q < a) {
      cout << "NO\n";
      return 0;
    }
    p -= a * q;
    swap(p, q);
    long long g = gcd(p, q);
    if (g == 0) {
      cout << "NO\n";
      return 0;
    }
    p /= g;
    q /= g;
  }
  long long g = gcd(p, q);
  if (g == 0) {
    cout << "NO\n";
    return 0;
  }
  p /= g;
  q /= g;
  if (p == arr[n - 1] && q == 1) {
    cout << "YES\n";
    return 0;
  }
  cout << "NO\n";
}
