If there is no EnemySpawner in the Scene, then es.OnEnemyKilled() will fail because es is null (hence NullReferenceException), so you need to do a check before you run it.
To learn more about null reference exceptions, you can watch this video. We made it because this error is the most common one that beginners run into.