#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long int dup = n;
  long long int sum = 0;
  while (dup > 0) {
    if (dup > 9) {
      long long int temp = dup % 10;
      sum += temp;
    } else {
      sum += dup;
    }
    dup /= 10;
  }
  if (sum % n == 0)
    cout << "Yes";
  else
    cout << "No";
}
