#include <bits/stdc++.h>
using namespace std;
int N, Q;
vector<pair<int, int> > q[300001];
int arr[300001], two[20], tmp[20];
int can[21][21];
bool answ[300001];
int main() {
  scanf("%d %d", &N, &Q);
  for (int i = 1; i <= N; i++) {
    scanf("%d", &arr[i]);
  }
  for (int i = 1; i <= Q; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    q[a].push_back(pair<int, int>(b, i));
  }
  two[0] = 1;
  for (int i = 1; i < 20; i++) two[i] = two[i - 1] * 2;
  for (int i = 0; i < 20; i++)
    for (int j = 0; j < 20; j++) can[i][j] = N + 1;
  for (int i = N; i > 0; i--) {
    for (int j = 0; j < 20; j++) tmp[j] = N + 1;
    for (int j = 0; j < 20; j++) {
      if (arr[i] & two[j]) {
        tmp[j] = i;
        for (int k = 0; k < 20; k++) {
          tmp[k] = min(tmp[k], can[j][k]);
        }
      }
    }
    for (int j = 0; j < 20; j++) {
      if (arr[i] & two[j]) {
        for (int k = 0; k < 20; k++) {
          can[j][k] = min(can[j][k], tmp[k]);
        }
      }
    }
    for (pair<int, int> t : q[i]) {
      for (int k = 0; k < 20; k++) {
        if (arr[t.first] & two[k]) {
          if (tmp[k] <= t.first) answ[t.second] = true;
        }
      }
    }
  }
  for (int i = 1; i <= Q; i++) {
    if (answ[i])
      printf("Shi\n");
    else
      printf("Fou\n");
  }
}
