fork(1) download
  1. s = raw_input()
  2. k = input()
  3. n = len(s)
  4. if n % k != 0:
  5. print "NO";
  6. else:
  7. for i in range(0, n, n / k):
  8. if s[i:i + n / k] != s[i + n / k - 1:i:-1] + s[i]:
  9. print "NO"
  10. break
  11. else:
  12. print "YES"
  13.  
Runtime error #stdin #stdout #stderr 0.01s 7736KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 1, in <module>
EOFError: EOF when reading a line