main :: IO()
main = do
    [_,t] <- map read . words <$> getLine
    tls <- map read . words <$> getLine
    print $ getsolve tls t

getsolve :: [Integer] -> Integer -> Integer
getsolve tls time
    | length tls == 1	= time
    | otherwise			= min (nextHuman - nowHuman) (time) + getsolve (tail tls) time 
    where nowHuman 	= head tls
          nextHuman	= tls !! 1