INCOME TAXES - Unrecognized tax benefits (Details) - USD ($)
$ in Thousands
12 Months Ended
Dec. 31, 2020
Dec. 31, 2019
Dec. 31, 2018
Reconciliation of Unrecognized Tax Benefits, Excluding Amounts Pertaining to Examined Tax Returns [Roll Forward]      
Unrecognized tax benefits as of the beginning of the year $ 5,033 $ 2,433 $ 862
Increases related to prior year tax provisions 182 383 197
Decrease related to prior year tax provisions (888) (247)  
Increase related to current year tax provisions 1,812 2,464 1,374
Unrecognized tax benefits as of the end of the year $ 6,139 $ 5,033 $ 2,433