#include<bits/stdc++.h>
using namespace std;
bool isseven(int n){
  int temp;
  while(n>0){
    temp=n%10;
    if(temp%7==0) return true;
    n=n/10;}
  return false;
}
int main(){
  int n;
  cin>>n;
  if(isseven(n)){
    cout<<"Yes"<<endl;
  }
  else {
    cout<<"No"<<endl;
  }
  return 0;
}