# [Perl 6], 25 bytes

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

    {$^a==$^b|5-$b|$b-5|$b+5}

[Try it online!][TIO-jqzy38sv]

[Perl 6]: https://github.com/nxadm/rakudo-pkg
[TIO-jqzy38sv]: https://tio.run/##RYzBCoMwAEPv/YocylCmYnXtre62L9hNFJS1MKhT2skY6rd33UVDeCQQMilrhB@@OGlI@IW2nZS07Vee0n6lfcoDznzzerSIzPOlXFxV2We0D4eFIGia36ivOlqzOk9YEydZXSRl05DNX8AgK9ztrAjLEbw3lP9864xTRKA4CoPYV2nBBQKOF3E8/gA "Perl 6 – Try It Online"


Port of [@Arbo's solution](https://codegolf.stackexchange.com/a/178803/76162). This uses the Any Junction rather than checking if `a` is a the list. Technically, `^` could work as well.


### Explanation:

    {                        }  # Anonymous code block
     $^a==                      # Is the first input equal to
             |    |    |        # Any of
          $^b                       # The second input
              5-$b                  # 5 - b
                   $b-5             # b - 5
                         $b+5       # b + 5