(let ((n 0)
      (na (read)))
  (defun s (p q)
    (setq n (floor p q))
    (if (= q 1)
        n
        (s (mod p q) (/ q 10))))
  (if (= 0 (mod na (s na 1000000000)))
      (print "Yes")
      (print "No")))
