#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long p, q;
  while (scanf("%I64d %I64d", &p, &q) != EOF) {
    scanf("%d", &n);
    long long num;
    bool flag = true;
    for (int i = 1; i <= n; i++) {
      scanf("%I64d", &num);
      if (!flag) continue;
      if (q == 0 || p / q < num) flag = false;
      p -= q * num;
      swap(p, q);
    }
    if (flag && q == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
