package main import ( "bufio" "fmt" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) var out = bufio.NewWriter(os.Stdout) func solve(a, b, c, x int) string { gcd := Gcd(Gcd(a, b), c) if x%gcd == 0 { return "Yes" } else { return "No" } } func main() { buf := make([]byte, 1024*1024) sc.Buffer(buf, bufio.MaxScanTokenSize) sc.Split(bufio.ScanWords) a, b, c := nextInt(), nextInt(), nextInt() x := nextInt() ans := solve(a, b, c, x) PrintString(ans) } func nextInt() int { sc.Scan() i, _ := strconv.Atoi(sc.Text()) return i } func PrintInt(x int) { defer out.Flush() fmt.Fprintln(out, x) } func PrintString(x string) { defer out.Flush() fmt.Fprintln(out, x) } func Gcd(x, y int) int { if x == 0 { return y } if y == 0 { return x } /* if x < y { x, y = y, x } */ return Gcd(y, x%y) } func Lcm(x, y int) int { // x*yのオーバーフロー対策のため先にGcdで割る // Gcd(x, y)はxの約数のため割り切れる ret := x / Gcd(x, y) ret *= y return ret }