Erdős-Szekeres theorem for cyclic permutations