Python two solutions, one two-liner
\nclass Solution:\n    def canFormArray(self, arr: List[int], pieces: List[List[int]]) -> bool:\n        table = {l[0] : l for l in pieces}\n        cur = 0\n  
```\nclass Solution:\n    def canFormArray(self, arr: List[int], pieces: List[List[int]]) -> bool:\n        table = {l[0] : l for l in pieces}\n        cur = 0\n        while cur < len(arr):\n            if (arr[cur] not in table or arr[cur:cur + len(table[arr[cur]])] != table[arr[cur]]): return False\n            cur += len(table[arr[cur]])\n        return True\n```\n\n```\nclass Solution:\n    def canFormArray(self, arr: List[int], pieces: List[List[int]]) -> bool:\n        table = {l[0] : l for l in pieces}\n        return arr == list(chain(*[table[n] for n in arr if n in table]))\n```
['Python']