```
public boolean checkPossibility(int[] nums) {
int prev = Integer.MIN_VALUE;
int cur = Integer.MIN_VALUE;
boolean first = false;
for(int i =0;i< nums.length; i++)
{
if(nums[i] >= cur)
{
prev = cur;
cur = nums[i];
}
else
{
if(first == true) return false;
first = true;
if(nums[i] <= prev)
{
prev = cur;
}
else
{
cur = nums[i];
prev = nums[i];
}
}
}
return true;
}
```