# MATLAB / Octave, 38 bytes @(x)any(all([x;flip(x)]'==sort(x)',1)) [Online demo](http://ideone.com/613pjC)