A surgical stapling apparatus can comprise, in various instances, a staple cartridge comprising staples removably stored therein, a firing system configured to eject the staples from the staple cartridge, and an electric motor configured to drive the firing system. The stapling apparatus can further comprise a lockout system configured to, one, detect whether a first jaw is in an open position or a closed position relative to a second jaw and, two, prevent the electric motor from driving the firing system when the first jaw is not in a closed position.