#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1000000000")
using namespace std;
const int size = 300010;
const long long alphabet = 130;
const long long INF = 1000000000000000000;
const int intINF = 1000000000;
const double pi = 4 * atan(1.0);
const long long MOD = 1000000007;
vector<long long> mas;
int main() {
  long long p, q;
  int n;
  cin >> p >> q;
  cin >> n;
  mas.resize(n);
  for (int i = 0; i < n; i++) scanf("%I64d", &mas[i]);
  for (int i = 0; i < n; i++) {
    if (p == 0 || q == 0) {
      cout << "NO\n";
      return 0;
    }
    long long lol = p / q;
    long long cur = mas[i];
    if (cur > lol) {
      cout << "NO\n";
      return 0;
    }
    p -= cur * q;
    swap(p, q);
  }
  if (p == 0 || q == 0)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
