#include<stdio.h>

int main()
{
    long long a,c,k,c1,c2,c3,c4,c5,c6,c7,c8,c9;

   scanf("%lld",&a);
   c1=a%10;
   c2=a/10%10;
   c3=a/100%10;
   
   k=c1+c2+c3;
       if(a%k==0)
       printf("YES\n");
else printf("NO\n");
}
