#include <bits/stdc++.h>
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  unsigned long long t;
  while (b != 0) {
    t = b;
    b = a % b;
    a = t;
  }
  return a;
}
int main() {
  unsigned long long p, q;
  int n;
  std::vector<unsigned long long> a;
  std::cin >> p >> q;
  std::cin >> n;
  a.reserve(n);
  for (int i = 0; i < n; i++) {
    unsigned long long temp;
    std::cin >> temp;
    a.push_back(temp);
  }
  unsigned long long px = 1, py = a[0];
  unsigned long long qx = 0, qy = 1;
  unsigned long long temp;
  unsigned long long gc = gcd(p, q);
  p = p / gc;
  q = q / gc;
  for (auto itr = a.begin() + 1; itr != a.end(); itr++) {
    temp = py;
    py = (*itr) * py + px;
    px = temp;
    temp = qy;
    qy = (*itr) * qy + qx;
    qx = temp;
    if ((py > p) || (qy > q)) break;
  }
  if ((p == py) && (q == qy))
    std::cout << "YES" << std::endl;
  else
    std::cout << "NO" << std::endl;
}
