#include<iostream>
#include <bits/stdc++.h>
using namespace std;
int main (){
int x;
cin >> x;
int a =x/10;
x%=10;
if (a%x==0 || x%a==0)
cout << "YES" << endl;
else
cout << "NO" << endl;
return 0;
}
CgoKICAgICNpbmNsdWRlPGlvc3RyZWFtPgojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG1haW4gKCl7CmludCB4OwpjaW4gPj4geDsKIGludCBhID14LzEwOwogeCU9MTA7CiBpZiAoYSV4PT0wIHx8IHglYT09MCkKIGNvdXQgPDwgIllFUyIgPDwgZW5kbDsKIGVsc2UgCiBjb3V0IDw8ICJOTyIgPDwgZW5kbDsKICAgIHJldHVybiAwOwp9CiAKIAo=