result = []
sublist = []
separators = ('COMMENT', 'BORDER')
mylist = ['ABC', 'COMMENT', 'YES', 'YES', 'NO', '123', 'COMMENT','GONOW','MAKE','COMMENT', 'YES','COMMENT', 'BORDER', 'FOO', '123']
for x in mylist:
if x in separators:
if sublist:
result.append(sublist)
sublist = []
else:
sublist.append(x)
result.append(sublist)
print (result)