#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return (b) ? (gcd(b, a % b)) : (a); }
long long p, q;
long long A[150];
long double res;
int main() {
  int n;
  scanf("%I64d %I64d", &p, &q);
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &A[i]);
  }
  res = 0;
  long long down;
  long long up;
  up = 1;
  down = A[n];
  for (int i = n - 1; i >= 1; i--) {
    up += down * A[i];
    if (gcd(up, down) != 1) {
      up /= gcd(up, down);
      down /= gcd(up, down);
    }
    swap(up, down);
  }
  swap(up, down);
  if (up == p / gcd(p, q) && down == q / gcd(p, q)) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  return 0;
}
