#include<stdio.h>

int main(void){
  int N;
  scanf("%d",&N);
  int i;
  if(N/100%7==0 && N/100!= 0)
	printf("Yes");
  else if(N/10%7==0 && N/10!= 0)
    printf("Yes");
  else if(N%7==0 && N!=0)
    printf("Yes");
  else
    printf("No");
  return 0;
}