Idempotent left nondegenerate solutions of the Yang-Baxter equation are in one-to-one correspondence with twisted Ward left quasigroups, which are left quasigroups satisfying the identity (x∗y)∗(x∗z)=(y∗y)∗(y∗z). Using combinatorial properties of the Cayley kernel and the squaring mapping, we prove that a twisted Ward left quasigroup of prime order is either permutational or a quasigroup. Up to isomorphism, all twisted Ward quasigroups (X,∗) are obtained by twisting the left division operation in groups (that is, they are of the form x∗y=ψ(x−1y) for a group (X,⋅) and its automorphism ψ), and they correspond to idempotent latin solutions. We solve the isomorphism problem for idempotent latin solutions.