#include <iostream>
#include <vector>
#include <cmath>
#include <map>

using namespace std;
int N;

int main() {

  int A, B, C;
  int ret=0;

  cin >> N;

  if (N%7 == 0 || N/10%7 == 0 || N/100%7 == 0)
    printf("Yes\n");
  else
    printf("No\n");

  return 0;
}
