We consider a model of a massless particle in a D-dimensional space with the Lagrangian proportional to the Nth extrinsic curvature of the world line. We present the Hamiltonian formulation of the system and show that its trajectories are spacelike curves satisfying the conditions k(N+a) = k(N-a) and k(2N) = 0, a = 1,..., N - 1, where N less than or equal to [(D - 2)/2]. The first N curvatures take arbitrary values, which is a manifestation of N+1 gauge degrees of freedom; the corresponding gauge symmetry forms an algebra of the W type. This model describes D-dimensional massless particles, whose helicity matrix has N coinciding nonzero weights, while the remaining [(D- 2)/2] - N weights are zero. We show that the model can be extended to spaces with nonzero constant curvature. It is the only system with the Lagrangian dependent on the world-line extrinsic curvatures that yields irreducible representations of the Poincare group.