#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int cmp(const void *a, const void *b) { return *(char*)a - *(char*)b; }
#define MAX_SIZE 20
int main() {
char orig[MAX_SIZE + 1], doubled[MAX_SIZE + 2]; scanf("%s", orig);
char buff[MAX_SIZE + 2] = {'0',};
for (int i = strlen(orig); i > 0; i--) {
int n = (orig[i - 1] - '0') * 2 + buff[i];
buff[i - 1] += n / 10;
buff[i] = n % 10 + '0';
}
char *res = buff[0] > '0' ? buff : buff + 1;
strcpy(doubled, res);
qsort(orig, strlen(orig), sizeof(char), cmp);
qsort(res, strlen(res), sizeof(char), cmp);
puts(strcmp(orig, res) == 0 ? "Yes" : "No");
puts(doubled);
}
|