def color_cells(n: int, m: int, l: List[int]) -> Union[List[int], int]:
    """
    Dreamoon likes coloring cells very much.
    
    There is a row of $n$ cells. Initially, all cells are empty (don't contain any color). Cells are numbered from $1$ to $n$.
    
    You are given an integer $m$ and $m$ integers $l_1, l_2, \ldots, l_m$ ($1 \le l_i \le n$)
    
    Dreamoon will perform $m$ operations.
    
    In $i$-th operation, Dreamoon will choose a number $p_i$ from range $[1, n-l_i+1]$ (inclusive) and will paint all cells from $p_i$ to $p_i+l_i-1$ (inclusive) in $i$-th color. Note that cells may be colored more one than once, in this case, cell will have the color from the latest operation.
    
    Dreamoon hopes that after these $m$ operations, all colors will appear at least once and all cells will be colored. Please help Dreamoon to choose $p_i$ in each operation to satisfy all constraints.
    
    
    -----Input-----
    
    The first line contains two integers $n,m$ ($1 \leq m \leq n \leq 100\,000$).
    
    The second line contains $m$ integers $l_1, l_2, \ldots, l_m$ ($1 \leq l_i \leq n$).
    
    
    -----Output-----
    
    If it's impossible to perform $m$ operations to satisfy all constraints, print "'-1" (without quotes).
    
    Otherwise, print $m$ integers $p_1, p_2, \ldots, p_m$ ($1 \leq p_i \leq n - l_i + 1$), after these $m$ operations, all colors should appear at least once and all cells should be colored.
    
    If there are several possible solutions, you can print any.
    
    
    -----Examples-----
    
    Input
    5 3
    3 2 2
    
    Output
    2 4 1
    
    Input
    10 1
    1
    
    Output
    -1
    """


# Tests

def check(candidate):
    assert color_cells(5, 3, [3, 2, 2]) == [2, 4, 1]
    assert color_cells(10, 1, [1]) == -1
    assert color_cells(1, 1, [1]) == [1]
    assert color_cells(2, 2, [1, 2]) == -1
    assert color_cells(200, 50, [49, 35, 42, 47, 134, 118, 14, 148, 58, 159, 33, 33, 8, 123, 99, 126, 75, 94, 1, 141, 61, 79, 122, 31, 48, 7, 66, 97, 141, 43, 25, 141, 7, 56, 120, 55, 49, 37, 154, 56, 13, 59, 153, 133, 18, 1, 141, 24, 151, 125]) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 76]
    assert color_cells(3, 3, [3, 3, 1]) == -1
    assert color_cells(100000, 1, [100000]) == [1]
    assert color_cells(2000, 100, [5, 128, 1368, 1679, 1265, 313, 1854, 1512, 1924, 338, 38, 1971, 238, 1262, 1834, 1878, 1749, 784, 770, 1617, 191, 395, 303, 214, 1910, 1300, 741, 1966, 1367, 24, 268, 403, 1828, 1033, 1424, 218, 1146, 925, 1501, 1760, 1164, 1881, 1628, 1596, 1358, 1360, 29, 1343, 922, 618, 1537, 1839, 1114, 1381, 704, 464, 692, 1450, 1590, 1121, 670, 300, 1053, 1730, 1024, 1292, 1549, 1112, 1028, 1096, 794, 38, 1121, 261, 618, 1489, 587, 1841, 627, 707, 1693, 1693, 1867, 1402, 803, 321, 475, 410, 1664, 1491, 1846, 1279, 1250, 457, 1010, 518, 1785, 514, 1656, 1588]) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 413]
    assert color_cells(10000, 3, [3376, 5122, 6812]) == [1, 2, 3189]
    assert color_cells(99999, 30, [31344, 14090, 93157, 5965, 57557, 41264, 93881, 58871, 57763, 46958, 96029, 37297, 75623, 12215, 38442, 86773, 66112, 7512, 31968, 28331, 90390, 79301, 56205, 704, 15486, 63054, 83372, 45602, 15573, 78459]) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 5968, 21541]
    assert color_cells(100000, 10, [31191, 100000, 99999, 99999, 99997, 100000, 99996, 99994, 99995, 99993]) == -1
    assert color_cells(1000, 2, [1, 1]) == -1
    assert color_cells(10, 3, [1, 9, 2]) == [1, 2, 9]
    assert color_cells(6, 3, [2, 2, 6]) == -1
    assert color_cells(100, 3, [45, 10, 45]) == [1, 46, 56]
    assert color_cells(6, 3, [1, 2, 2]) == -1
    assert color_cells(9, 3, [9, 3, 1]) == [1, 6, 9]
check(color_cells)