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