#include <stdio.h>
#include <math.h>

int main() {
    int n;
    scanf("%d", &n);
    
    if(n<0) {
        printf("Invalid input");
        return 0;
    }
    
    int t = n, digitcount = 0;
    while (t) temp /= 10, d++;
    
    t = n;
    int sum = 0;
    while (temp) {
        int r = temp % 10;
        sum += pow(r, d);
        t /=10;
    }
    
    printf(sum == n ? "True" : "False");
}