Irish Snap: Variant Rules Introduction

Recently, me and a couple of my friends decided to play some cards, and one of them suggested the game 'Irish Snap', which was the inspiration for this challenge. However, I later learnt that the game has a lot of different rules that you can play with, some of which are listed  here. The rules that are in this challenge aren't currently listed on that page, hence the name, 'Variant Rules'

The Challenge

Given an array of 3 cards, output a truthy or falsey value depending on if they make a valid snap in a game of Irish snap.

Input

The input will be an array of 3 numbers, ranging from 1-13 inclusive, with 1 representing an ace, 11 representing a jack, 12 representing a queen and 13 representing a king. The input can be in any order of top, middle, bottom.

Rules

The 4 different criteria for if cards make an Irish snap are:


The top and middle cards are the same
The top and middle cards have a difference of one
The top and bottom cards are the same
The top and bottom cards have a difference of one


If any of these criteria are met, you must output a truthy value. As well as this, for the two criteria that require the cards to have a difference of one, it 'wraps around', meaning that an ace and a king are considered to have a difference of one, and vice versa.

Test Cases

Input (Bottom, Middle, Top) -&gt; Output
1 13 7 -&gt; False
1 4 13 -&gt; True
9 3 6 -&gt; False
8 9 7 -&gt; True
2 6 5 -&gt; True
12 5 11 -&gt; True
10 4 8 -&gt; False
12 13 7 -&gt; False
9 7 10 -&gt; True
7 3 1 -&gt; False
4 2 3 -&gt; True
Perl 6, 16 bytes



3&gt;(*-(*|*)+1)%13


Try it online!

Anonymous whatever lambda that takes input as top, middle, bottom and returns a Junction that evaluates to True or False