1D monochrome Link-a-Pix solvability Background
Link-a-Pix is a puzzle on a rectangular grid, where the objective is to reveal the hidden pixel art by the following rules:

Connect two cells with number N with a line spanning N cells, so that the two cells are at the two ends of the line.
The number 1 is considered connected to itself (which makes it an exception to the rule of &quot;connect two cells&quot;).
Two different lines are not allowed to overlap.
The puzzle is solved when all the given numbers on the grid are connected by the above rules. There may be some unused cells after the puzzle is solved.

The following is an example puzzle and its unique solution.

(Source: The NP completeness of some lesser known logic puzzles, 2019)
A Link-a-Pix puzzle often involves colors and reveals a colorful picture when solved, but we will ignore them for simplicity, and focus on &quot;monochrome&quot; puzzles.
Task
In this challenge, the puzzle is limited to one dimension, or equivalently, a grid of height 1.
Given a 1D Link-a-Pix puzzle instance, check if it has a solution or not. A puzzle instance is given as a sequence of non-negative integers, where each cell with a given number contains that number and the others contain 0.
For output, you can choose to

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

Test cases
Truthy
[0, 1, 0, 4, 0, 0, 4, 2, 2, 0, 1]
[0, 0, 0, 0] (the puzzle is solved vacuously)
[12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12] (multi-digit numbers must be supported)
[2, 2, 0, 2, 2, 2, 2, 1, 2, 2] (suggested by tsh)

Falsy
[0, 4, 0, 3, 4, 3, 0] (two lines cannot overlap)
[3, 0, 3, 0, 3, 1, 3, 0, 3, 0, 3]
[1, 0, 2, 2, 2, 2, 2, 0, 1] (one of 2s have nowhere to connect)
[3, 3, 3, 3] (suggested by tsh)
[3, 3, 3]
[0, 0, 4, 4] (the 4s must begin and end the 4-cell line)
[12, 2] (multi-digit numbers must not be treated as multiple single-digit numbers)
JavaScript (ES6), 41 bytes
Returns false for valid or true for invalid.

a=&gt;a.some(p=(x,i)=&gt;--p&gt;0?x:a[i+x-1]^=p=x)

Try it online!
Commented
a =&gt;            // a[] = input
a.some(p =      // start with p NaN'ish
  (x, i) =&gt;     // for each value x at position i in a[]:
  --p &gt; 0 ?     //   decrement p; if it's positive:
    x           //     make sure that we have x = 0
                //     (because we're currently over a connection 'line')
  :             //   else:
    a[          //     XOR the entry at ...
      i + x - 1 //     ... i + x - 1 ...
    ]           //
    ^= p = x    //     ... with x; and set p = x
                //     this must give 0 if the puzzle is valid
)               // end of some()

The trickiest case is when a \$0\$ is reached at position \$i\$ and we're currently outside a connection (i.e. \$p\le0\$), which causes the entry at \$i-1\$ to be XOR'ed with \$0\$. If the puzzle is valid, this will always result in \$0\$ as expected because:

if \$i=0\$, we do undefined ^ 0
if \$i&gt;0\$, the entry at \$i-1\$ either was already set to \$0\$ or was cleared by the previous XOR