#include<stdio.h>

int main()
{
    int n, num[10] = {0};
    int i, t, sum;

    ///*lgg*/freopen("data.in", "r", stdin);
    scanf("%d", &n);

    t = n;
    for(i = 0; i < 10; i++)
    {
        num[i] = t % 10;
        t = t / 10;
        ///*lgg*/printf("%d", num[i]);
    }

    sum = 0;
    for(i = 0; i < 10; i++)
    {
        sum += num[i];
    }
    if(n % sum == 0)
        printf("YES");
    else
        printf("NO");
    
    return 0;
}