public static boolean canJump(int[] A) {
    	int max = 0;
    	for (int i = 0; i < A.length; i++) {
    		if (max < i) return false;
    		if (max >= A.length - 1) return true;
    		if (i + A[i] > max) max = i + A[i];
    	}
    	return false;
    }