#include <bits/stdc++.h>
using namespace std;
int main() {
  string num;
  cin >> num;
  int n = 0;
  int N = 0;
  for (int i = 0; i < num.size(); i++) {
    n += num[i] - '0';
    N = N * 10 + (num[i] - '0');
  }
  if (N % n == 0)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
