{-# LANGUAGE OverloadedStrings #-}

import Control.Monad
import qualified Data.ByteString.Char8 as B
import Data.Attoparsec.ByteString.Char8

main :: IO ()
main = do
  contents <- B.getContents
  case parseOnly inputParser contents of
    Right r -> B.putStrLn $ if solve r then "Yes" else "No"
    Left  e -> error e

inputParser = decimal

solve :: Int -> Bool
solve n = any (match n) [1 .. 9]
  where
    match n k = r == 0 && q < 10
      where (q, r) = n `divMod` k