#include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
int main()
{
	int n, m, i, sum=0;

	scanf("%d", &n);
	m=n;

	while(n!=0)
	{
		sum += n%10;
		n/=10;
	}
	m%sum==0?printf("YES\n"):printf("NO\n");

	return 0;
}