# Scala, 43 bytes

<!-- language-all: lang-scala -->

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

[Try it online!](https://tio.run/##dcyxCoMwFAXQ3a94SIeEajFaHQopdOzQj3jRCBaJ0mQoqN@eJoGiRZrhQi7nXV1jj3YQT1kbeGCnQL6NVI2G2zjCFNlGttASvNyVSYRPyvEoOC/nmWAq6AmFDj/kXFiA8dUp0yui43MC7jEf/AqHqSWuYXSJabRlLPOOZSvzDcv2MOwVmz3XFDtWBZZvmGvyP2vV71q1Y2leunOX7MvWJuDFfgA)