Massive, massless and ghost modes of gravitational waves from higher-order gravity