# [Brachylog (newer)], 11 bytes

    d"ab"&ḅlᵐ=Ċ

[Try it online!][TIO-jsppr6xk]

[Brachylog (newer)]: https://github.com/JCumin/Brachylog
[TIO-jsppr6xk]: https://tio.run/##SypKTM6ozMlPN/pf/ahtw6Ompkcdy5VKikpTlfRqQMy0xJziVKXa04vK/6coJSYpqT3c0ZrzcOsE2yNd//9Hg0R0lBITkyAUkIYyQCwYE8yGcyA8EBckAsQQGRADTEAVQowFkWBhiA1JUHVgNlQ5zGCoAyD6IFoSoRTEGJg5UIMgJkGMgmhIgloCtQVmDcyeJKVYAA "Brachylog – Try It Online"

The predicate succeeds if the input is in L and fails otherwise.

```brachylog
d              With duplicate characters removed,
 "ab"          the input is "ab".
     &         And,
      ḅlᵐ      the run lengths
         =Ċ    are two equal values.
               (which are output, but we don't need to care about that)
```