#include<stdio.h>
int main()
{
	int n;
	while(scanf("%d",&n)!=EOF)
	{
		int t,a,s=0;
		a=n;
		while(a)
		{
			t=a%10;
			s+=t;			
			a=a/10;
		}
		if(n%s==0)
		{
			printf("YES\n");
		}
		else printf("NO\n");
	}
	return 0;
}