#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n, s;
    s = 0;
    scanf("%d",&n);
    while(n)
    {
        s = s + n%10;
        n = n/10;

    }
    if (n%s==0)     printf("YES\n");
    else            printf("NO\n");
    return 0;
}
