#include <stdio.h>
#include <string.h>
int main()
{
char ticket[] = "375456654572";
int a = 0, b = 0;
for (int i=0;i<12; i++)
{
if (i < 6){
a += ticket[i] - '0';
}
else{
b += ticket[i] - '0';
}
}
printf("%d \n",a);
printf("%d \n",b);
if (b == a)
{
printf("YES");
}
else
{
printf("NO");
}