Related: [What's my telephone number?](https://codegolf.stackexchange.com/q/198237) which asks to calculate the terms of [A000085](https://oeis.org/A000085), the number of possible ordinal transforms of length n.

Background
----------

**[Ordinal transform](https://oeis.org/wiki/Ordinal_transform)** is a transformation on an integer sequence. For a sequence \$a=(a\_0, a\_1, a\_2, \cdots)\$, the \$n\$-th term of the ordinal transform \$ord(a)\_n\$ is defined as the occurrence count of \$a\_n\$ in \$a\_0, a\_1, \cdots, a\_n\$. Informally, \$ord(a)\$ can be described as "the value \$a\_n\$ appears the \$ord(a)\_n\$-th time in the sequence \$a\$".

For example, the sequence `[1, 2, 1, 1, 3, 2, 2, 3, 1]` transforms into `[1, 1, 2, 3, 1, 2, 3, 2, 4]`.

```none
1, 2, 1, 1, 3, 2, 2, 3, 1
1, 1, 2, 3, 1, 2, 3, 2, 4
^     ^  ^              ^
|     |  |              4th occurrence of 1
|     |  3rd occurrence of 1
|     2nd occurrence of 1
1st occurrence of 1

```

The number of possible ordinal transforms is [A000085](https://oeis.org/A000085). A hint to tackle this problem can be found on the page (search for "ballot sequences").

Challenge
---------

Given a non-empty finite integer sequence, test if it can be the result of ordinal transform of some integer sequence.

You can assume the input entirely consists of positive integers.

For output, you can choose to

1. output truthy/falsy using your language's convention (swapping is allowed), or
2. use two distinct, fixed values to represent true (affirmative) or false (negative) respectively.

Standard [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") rules apply. The shortest code in bytes wins.

Test cases
----------

**Truthy**

```none
[1]
[1, 1]
[1, 2, 3, 1]
[1, 1, 2, 2]
[1, 2, 1, 2, 1, 2, 1]
[1, 2, 3, 4, 5, 6, 7]
[1, 1, 2, 3, 1, 2, 3, 2, 4]
[1, 1, 2, 3, 4, 2, 1, 3, 2, 1]

```

**Falsy**

```none
[2]
[6]
[1, 3]
[2, 1, 1]
[1, 2, 2, 1]
[1, 2, 3, 2]
[1, 2, 3, 4, 4]
[1, 2, 3, 2, 1]

```