check if p is in (0,1)