chars = gets.chomp.chars sort_chars = chars.sort i = 0 j = 1 fault = false while j <= sort_chars.length unless sort_chars[i] == sort_chars[j] fault = true break end i += 2 j += 2 end half = chars.length / 2 k,l = 0,half while k < half unless chars[k] == chars[l] fault = true break end k += 1 l += 1 end puts fault ? "NO" : "YES"