#include <bits/stdc++.h>
int main(void) {
  long long n, nc;
  int sum = 0;
  scanf("%lld", &n);
  nc = n;
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  if (nc % sum == 0) {
    puts("YES");
  } else {
    puts("NO");
  }
  return 0;
}
