Skip to main content
1 of 3

#Scala, 45 bytes

def f(a:Int,b:Int)=a+b==5||(a-b).abs==5||a==b

Try it online!