Returns a boolean indicating if an input array is sorted.