#include <bits/stdc++.h>
long long int gcd(long long int x, long long int y) {
  if (x < y) {
    int t = x;
    x = y;
    y = t;
  }
  if (x % y == 0)
    return y;
  else
    return gcd(y, x % y);
}
int solve(long long int x, long long int y) {
  long long int t = gcd(x, y);
  x /= t, y /= t;
  while (x % 2 == 0) x /= 2;
  while (x % 3 == 0) x /= 3;
  while (y % 2 == 0) y /= 2;
  while (y % 3 == 0) y /= 3;
  if (x > 1 || y > 1)
    return 0;
  else
    return 1;
}
int main() {
  int n, i;
  long long int a, b;
  while (scanf("%d", &n) == 1) {
    scanf("%I64d", &a);
    int check = 1;
    for (i = 2; i <= n; i++) {
      scanf("%I64d", &b);
      check = check < solve(a, b) ? check : solve(a, b);
    }
    if (check)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
