#include <stdio.h>
int main(){
    int N;
    int temp,num,cont;
    100 <= N <= 999;
    
    scanf("%d", &N);

    num = 100;
    cont = 0;
    do {   
        temp = N / num;
        //printf("%d",N);
        if(temp%7 == 0){
            cont = cont + 1;
        }else{
            cont = cont + 0;
        }
        N = N - (num * temp);
        num = num / 10;
    }while(num != 0);
    
    if(cont != 0){
        puts("yes");
    }else{
        puts("no");
    }

    return 0;
}