#include <stdio.h>                                                                                                                                         
#include <string.h>                                                                                                                                        
#include <stdlib.h>                                                                                                                                        
                                                                                                                                                           
int main(void)                                                                                                                                             
{                                                                                                                                                          
        int sum = 0, i, len, num;                                                                                                                          
        char str[10] = { 0 };                                                                                                                              
        char tmp[2] = { 0 };                                                                                                                               
                                                                                                                                                           
        scanf("%s", str);                                                                                                                                  
        len = strlen(str);                                                                                                                                 
        num = atoi(str);                                                                                                                                   
                                                                                                                                                           
        for (i = 0; i < len; i++) {                                                                                                                        
                tmp[0] = str[i];                                                                                                                           
                sum += atoi(tmp);                                                                                                                          
        }                                                                                                                                                  
        if (num % sum == 0) {                                                                                                                              
                printf("Yes\n");                                                                                                                           
        } else {                                                                                                                                           
                printf("No\n");                                                                                                                            
        }                                                                                                                                                  
        return 0;                                                                                                                                          
} 

Measured memory_bytes: 128