game-of-thornes

Dothraki are planning an attack to usurp King Robert's throne. King Robert learns of this conspiracy from Raven and plans to lock the single door through which the enemy can enter his kingdom.

But, to lock the door he needs a key that is an anagram of a certain palindrome string.

The king has a string composed of lowercase English letters. Help him figure out whether any anagram of the string can be a palindrome or not. 

Input Format
A single line which contains the input string.

Constraints
1≤ length of string ≤105
Each character of the string is a lowercase English letter.

Output Format
A single line which contains YES or NO in uppercase.

SAMPLE INPUT
aaabbbb

SAMPLE OUTPUT
YES

Explanation

A palindrome permutation of the given string is bbaaabb.

Source: hackerearth | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
word = input()
s=set(word)
n=0
for x in s:
	if(word.count(x)%2==1):
		n=n+1
	
if(n>1):
	print("NO")
else:
	print("YES")
	



word = input()

l=list(word)
s=set(word)
n=0
for x in s:
	if(word.count(x)%2==1):
		n=n+1
	
if(n>1):
	print("NO")
else:
	print("YES")
	



inp = input()
stlen = len(inp)
dic = {}
count = 0
for i in inp:
	if i not in dic:
		dic[i] = 1
	else:
		dic[i] = dic[i] + 1
for i in list(dic.values()):
	if i % 2 != 0:
		count = count + 1
		
if stlen % 2 == 0:
	if count == 0:
		print("YES")
	else:
		print("NO")
else:
	if count == 1:
		print("YES")
	else:
		print("NO")
		


ip = input()
l = len(ip)
A = []
for i in range(26):
	A.append(0)
for i in range(l):
	A[ord(ip[i])-ord('a')] += 1
c = 0	
for i in range(26):
	if A[i] % 2 == 1:
		c = c + 1
if c == 1 and l % 2 == 1 :
	print("YES")
elif c == 0:
	print("YES")
else:
	print("NO")


def is_palindrome(s):
	memo={}
	even=0
	odd=0
	ans= False
	for i in s:
		if i not in memo:
			memo[i]=1
		else:
			memo[i]+=1
	if(len(s)%2==0):
		for i in memo:
			if(memo[i]%2==0):
				ans = True
			else:
				ans = False
				break
		return ans
				
	else:
		for i in memo:
			if(memo[i]%2==0):
				even+=1
			else:
				odd+=1
		if(odd>1):
			return False
		else:
			return True
				
			
		
	
x=input()
x=list(x)
if(x==x[::-1]):
	print("Yes")
else:
	if(is_palindrome(x)):
		print("YES")
	else:
		print("NO")
		
	


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
s = input()
n = len(s)
d = {}
for c in s:
	if c in d:
		d[c] += 1
	else:
		d[c] = 1

nodd = 0
for key in d:
	if d[key] % 2 == 1:
		nodd += 1

if n%2 == 0 and nodd == 0:
	print("YES")
elif n%2 == 1 and nodd == 1:
	print("YES")
else:
	print("NO")
	


'''
from collections import Counter

ins = raw_input()
incs = Counter(ins)
lens = len(ins)
from itertools import groupby
res= [len(list(group)) for key, group in groupby(incs)]
if res == [1,1] or res == [1]:
	print "YES"
else:
	print "NO"
'''
from collections import Counter

ins = input()
incs = Counter(ins)
oddlen=False
if len(ins) & 1 == 1:
	oddlen = True
odddone=False    
flag = True    
for k,v in list(incs.items()):
	if v%2==1:
		if oddlen:
			if odddone==False:
				odddone=True
				continue
			else:
				flag=False
				break
		else:
			flag=False
			break 
print(("YES" if flag==True else "NO"))        
				
				
			
			
		
	
	
	
	
	
	




s=input()
ar=[0]*26
for i in range(len(s)):
	l=ord(s[i])-97
	ar[l]+=1
list=[j for j in ar if j%2!=0]
if len(list)==0 or len(list)==1:
	print("YES");
else:
	print("NO");
	


s = list(input())
s.sort()
ss = list(set(s))
ss.sort()
arr = []
i = 0
j = 0
cnt = 0
for i in ss:
	cnt = 0
	for j in s:
		if i==j:
		   cnt+=1
	arr.append(cnt)
arr.sort()
nOdd = 0
for i in arr:
	if i%2!=0:
		nOdd+=1
		if nOdd>1:
			break
if nOdd>1:
	print('NO')
else:
	print('YES')


text=input()
d = dict.fromkeys(text, 0)
for c in text: d[c] += 1
x=[]
flag=0
for key, value in d.items():
	x.append([key,value])
i=0
while i<len(x):
	if x[i][1]%2!=0:
		if flag==0:
			flag=1
		else:
			print("NO")
			i=len(x)+1
	i=i+1
if i==len(x):
	print("YES")