A speciality theorem for curves in P5