Problem description

Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.

Petya calls a number almost lucky if it could be evenly divided by some lucky number. Help him find out if the given number n is almost lucky.

Input

The single line contains an integer n (1 ≤ n ≤ 1000) — the number that needs to be checked.

Output

In the only line print "YES" (without the quotes), if number n is almost lucky. Otherwise, print "NO" (without the quotes).

Examples

Input

47

Output

YES

Input

16

Output

YES

Input

78

Output

NO

Note

Note that all lucky numbers are almost lucky as any number is evenly divisible by itself.

In the first sample 47 is a lucky number. In the second sample 16 is divisible by 4.

解题思路:幸运数字只由4和7组成。题目要求判断输入的数字n是否可以整除这些幸运数字中的某一个,如果可以为"YES",否则为"NO"。幸运数字就先打好表,其最大值不超过1000即可,简单水过!

AC代码:

 #include<bits/stdc++.h>
using namespace std;
int main(){
int n,obj[14]={,,,,,,,,,,,,,};
bool flag=false;cin>>n;
for(int i=;i<;++i)
if(n%obj[i]==){flag=true;break;}
if(flag)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
return ;
}

最新文章

  1. Hibernate单向多对一对象关系模型映射
  2. Coursera台大机器学习基础课程学习笔记2 -- 机器学习的分类
  3. 通过Eclipse创建SQLite数据库
  4. svn-主副分支使用
  5. php cgi 与 cli 区别
  6. 九款让WordPress成为赚钱利器的广告插件
  7. 深度学习系列之CNN核心内容
  8. 数据库复用代码【c3p0配置文件、数据库连接池】
  9. 我的代码-date
  10. 「SCOI2015」国旗计划 解题报告
  11. WebHttpRequest在sharepoint文档库中的使用
  12. JAVA中String类常用方法 I
  13. hbase-java-api001
  14. JS之计时器
  15. hive lateral view 与 explode详解
  16. oracle使用随笔
  17. Replication--对发布修改的一些小总结
  18. React 学习二 组件
  19. 【js】typeof与instanceof
  20. lua的table库

热门文章

  1. .htaccess使用
  2. BZOJ 2442: [Usaco2011 Open]修剪草坪 单调队列
  3. 面试bb
  4. 从0开始复习JS---1、函数复习
  5. Yii2开发技巧 使用类似闭包的方式封装事务
  6. git 的简单使用(3)
  7. HOG特征过程解释(转)
  8. Java基础学习总结(69)——匿名内部类与Lambda表达式
  9. 暑假集训D19总结
  10. MSXML2