JSFiddle - React, Tailwind, and code Playground

JavaScript

a=prompt().split(" ")
i=0;b=[];c=[]
while(b[i]=Math.abs(a[i]-a[++i]),c[i-1]=i,i<a.length-1);b.sort()
alert(b+""==c+""?"Jolly":"Not jolly")