input: Write a function to construct a neural network model in Python using Keras to classify the MNIST dataset correctly. The model should include an input layer with a shape of (784,), a hidden layer with 128 neurons using the ReLU activation function, and an output layer with 10 neurons using the softmax activation function. The model should then be compiled using the Adam optimizer, sparse categorical cross-entropy loss function, and accuracy as the metric.
  import keras
  
  # Input layer
  input_layer = keras.layers.Input(shape=(784,))
  
  # Hidden layer
  hidden_layer = keras.layers.Dense(128, 
                  activation='relu')(input_layer)
  
  # Output layer
  output_layer = keras.layers.Dense(10, 
                  activation='softmax')(hidden_layer)
  
  # Model
  model = keras.Model(inputs=input_layer, outputs=output_layer)
  
  # Compile model
  model.compile(optimizer='adam', 
                loss='sparse_categorical_crossentropy',
                metrics=['accuracy'])
output: import keras
  
  # Input layer
  input_layer = keras.layers.Input(shape=(784,))
  
  # Hidden layer
  hidden_layer = keras.layers.Dense(128, 
                  activation='relu')(input_layer)
  
  # Output layer
  output_layer = keras.layers.Dense(10, 
                  activation='softmax')(hidden_layer)
  
  # Model
  model = keras.Model(inputs=input_layer, outputs=output_layer)
  
  # Compile model
  model.compile(optimizer='adam', 
                loss='sparse_categorical_crossentropy',
                metrics=['accuracy'])