program ds
    implicit none
    integer(4) n,ntmp
    integer :: i=0,digit=0,tmp=0,sn=0

    read(*,*) n
    ntmp = n
    if(n<1 .or. 10**9<n)then
    else
        do i=0,9
        if(.not. n/(10**i)==0)then
            digit = digit + 1
        else
        endif
        enddo

        do i=0,digit
            tmp = ntmp/(10**(digit-i))
            sn = sn + tmp
            ntmp = ntmp - tmp*10**(digit-i)
            write(*,*) tmp,sn,ntmp
        enddo
    
        if(mod(n,sn) == 0)then
            write(*,*) 'Yes'
        else
            write(*,*) 'No'
        endif
    endif

end program ds 