package main import ( "bufio" "fmt" "io" "os" "strconv" ) func main() { sc := NewScanner(os.Stdin) H, _ := sc.NextInt() W, _ := sc.NextInt() N, _ := sc.NextInt() K, _ := sc.NextInt() fmt.Println(solve(H, W, N, K)) } func solve(h, w, n, k int) string { loser := h * w % n if loser == 0 { loser = n } if loser == k { return "YES" } else { return "NO" } } type Scanner struct { *bufio.Scanner } func NewScanner(r io.Reader) *Scanner { return &Scanner{ bufio.NewScanner(r), } } func (s *Scanner) Next() (string, error) { s.Scanner.Split(bufio.ScanWords) return s.nextToken() } func (s *Scanner) nextToken() (string, error) { sc := s.Scanner if sc.Scan() { return sc.Text(), nil } if sc.Err() != nil { return "", sc.Err() } return "", io.EOF } func (s *Scanner) NextInt() (int, error) { token, err := s.Next() if err != nil { return 0, err } return strconv.Atoi(token) }