class A {
public static boolean isDirectedOrder(int[] d) {
if (d == null) return true;
for (int i = 0, l = d.length - 1; i < l; i ++) if (d[i] > d[i + 1]) return false;
return true;
}
public static void main(String[] args) {
System.out.println(isDirectedOrder(new int[] { 1, 2, 3, 4, 5, 6, 8, 10 }));
System.out.println(isDirectedOrder(new int[] { 1 }));
System.out.println(isDirectedOrder(new int[] { 3, 2, 5, 1, 5, 7 }));
}
}