#include<stdio.h>
int main()
{
   long long int n,sum=0,p,d;
    
    scanf("%lld",&n);
    d=n;
   long long int a,b;
    while(n!=0)
    {
       p=n%10;
        n=n/10;
        sum=sum+p; 
        
        
    }
    if(d%sum==0)
    {
        printf("YES\n");
    }
    else
    {
        printf("NO\n");
    }
}