You can take advantage of $all operator building your query condition,
db.col.update({ accounts: { $not: { $all: [2, 1] } } }, { $push: { accounts: { $each: [ 2, 1 ] } } }) // will return no match
while
db.col.update({ accounts: { $not: { $all: [1, 3] } } }, { $push: { accounts: { $each: [ 1, 3 ] } } })
will succesfully update your document since not all elements are present in accounts array
EDIT:
To prevent inserting the document you need an index with unique parameter. By default MongoDB creates separate index entries for every element of the array which means that you will be able to insert 1 only once. As a workaroung you can try to create compound index using array index:
db.col.createIndex( { "accounts.0": 1, "accounts.1": 1 }, { unique: true } )
This requires pairs of numbers to be unique but order matters here so you have to enforce your application to insert accounts as ordered array.