input: Write a function to create a neural network model using Keras in Python to correctly classify the MNIST dataset. The function should define and compile the model with appropriate layers, optimizer, loss function, and evaluation metric.
  assert classify_mnist_with_keras() == "Model successfully created and compiled"
output: def classify_mnist_with_keras():
      from tensorflow.keras.models import Sequential
      from tensorflow.keras.layers import Dense, Flatten
      from tensorflow.keras.optimizers import Adam
  
      model = Sequential([
          Flatten(input_shape=(28, 28)),
          Dense(128, activation='relu'),
          Dense(10, activation='softmax')
      ])
  
      model.compile(optimizer=Adam(),
                    loss='sparse_categorical_crossentropy',
                    metrics=['accuracy'])
      
      return "Model successfully created and compiled"