#include<stdio.h>

int main()
{
	int n;
	scanf("%d",&n);
	int sss(int x);
	if(n%sss(n) == 0)
	printf("YES");
	else
	printf("NO");
	
}

int sss(int x)
{
	int sum=0;
	int y;
	while(x>0)
{
	y=x%10;
	sum+=y;
	x/=10;
}
return sum;
}