#include <bits/stdc++.h>
using namespace std;
long long int A[108];
int main() {
  long long int p, q;
  while (scanf("%lld%lld", &p, &q) == 2) {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      scanf("%lld", &A[i]);
    }
    bool flag = false;
    for (int i = 1; i <= n; i++) {
      if (q == 0) {
        flag = true;
        break;
      }
      if (p / q < A[i]) {
        flag = true;
        break;
      }
      p -= q * A[i];
      long long int temp = p;
      p = q;
      q = temp;
    }
    if (q == 0 && !flag)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
