The number of different seven-digit numbers that can be written using only three digits 1,2 and 3 under the condition that the digit two occurs exactly twice in each number is

A) 672
B) 640
C) 512
D) None of these