using System; using System.Collections.Generic; using System.Linq; namespace Test { class Program { static void Main(string[] args) { long[] x = Console.ReadLine().Split().Select(long.Parse).ToArray(); long a = x[0] % x[2]; a *= x[1] % x[2]; Console.WriteLine(a % x[2] == x[3] % x[2] ? "YES" : "NO"); } } }