Check that the input is in bounds