```
public class Solution {
public boolean canJump(int[] nums) {
int n = nums.length;
int closestJump = n-1;
for(int i = n-2;i>=0;i--){
if(i+nums[i]>=closestJump){
closestJump = i;
}
}
return closestJump <= 0;
}
}
```