A controller for a baler, includes an ejecting position acquisition circuit, a prohibited position acquisition circuit, and a control circuit. The ejecting position acquisition circuit is configured to acquire an ejecting position at which an ejecting unit of the baler is configured to eject a bale of grass. The prohibited position acquisition circuit is configured to acquire a prohibited position. The control circuit is configured to control the ejecting unit to eject the bale at the ejecting position if the ejecting position is different from the prohibited position.