#include <bits/stdc++.h>
using namespace std;
int ketanowa(int n) {
  int a = 0;
  while (n > 0) {
    a += n % 10;
    n /= 10;
  }
  return a;
}
int main() {
  int N;
  cin >> N;
  int x = ketanowa(N);
  if (N % x == 0)
    cout << "Yes" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
