#include <bits/stdc++.h>
using namespace std;

signed main () {
    int n;
    cin >> n;
    if (n == 0) {
        cout << 0 << '\n';
        return 0;
    }
    string ans;
    while (n) {
        if (n % (-2) == 0)
            ans += '0';
        else 
            --n, ans += '1';
        n /= -2;
    }
    reverse(ans.begin(), ans.end());
    cout << ans << '\n';
}

#include <bits/stdc++.h>
#include <math.h>
using namespace std;

int main() {
    int N, sum, digit;
    cin >> N;
    digit = log10(N);
    sum = 0;
    for (int i = 0; i <= digit; i++) {
        sum += N % (int (pow(10, i + 1))) / (int (pow(10, i)));
    }
    if (N % sum == 0) {
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}
