using System; using System.Collections.Generic; using static System.Console; using System.Linq; class yuki320 { static int NN => int.Parse(ReadLine()); static long[] NList => ReadLine().Split().Select(long.Parse).ToArray(); static void Main() { var c = NList; var (x, a, y, b) = (c[0], c[1], c[2], c[3]); var xp = PDiv(x); var yp = PDiv(y); foreach (var kv in yp) { if (!xp.ContainsKey(kv.Key) || xp[kv.Key] * a < kv.Value * b) { WriteLine("No"); return; } } WriteLine("Yes"); } static Dictionary PDiv(long n) { var dic = new Dictionary(); var tmp = n; while (tmp % 2 == 0) { tmp /= 2; if (dic.ContainsKey(2)) ++dic[2]; else dic.Add(2, 1); } for (var p = 3L; p * p <= n; p += 2) { while (tmp % p == 0) { tmp /= p; if (dic.ContainsKey(p)) ++dic[p]; else dic.Add(p, 1); } if (tmp == 1) break; } if (tmp > 1) dic.Add(tmp, 1); return dic; } }