Exclude trajectories that include molecules appearing in the first or
last frame